Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 376c5e1 + 4993c4a commit a896421Copy full SHA for a896421
1 file changed
docs/en/cookbook/working-with-datetime.rst
@@ -113,7 +113,7 @@ the UTC time at the time of the booking and the timezone the event happened in.
113
$converted = \DateTime::createFromFormat(
114
$platform->getDateTimeFormatString(),
115
$value,
116
- self::$utc ? self::$utc : self::$utc = new \DateTimeZone('UTC')
+ self::getUtc()
117
);
118
119
if (! $converted) {
@@ -126,6 +126,11 @@ the UTC time at the time of the booking and the timezone the event happened in.
126
127
return $converted;
128
}
129
+
130
+ private static function getUtc()
131
+ {
132
+ return self::$utc ? self::$utc : self::$utc = new \DateTimeZone('UTC');
133
+ }
134
135
136
This database type makes sure that every DateTime instance is always saved in UTC, relative
0 commit comments