Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a896421

Browse files
authored
Merge pull request doctrine#7781 from tybulewicz/patch-1
Missing method `getUtc` added
2 parents 376c5e1 + 4993c4a commit a896421

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

docs/en/cookbook/working-with-datetime.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ the UTC time at the time of the booking and the timezone the event happened in.
113113
$converted = \DateTime::createFromFormat(
114114
$platform->getDateTimeFormatString(),
115115
$value,
116-
self::$utc ? self::$utc : self::$utc = new \DateTimeZone('UTC')
116+
self::getUtc()
117117
);
118118
119119
if (! $converted) {
@@ -126,6 +126,11 @@ the UTC time at the time of the booking and the timezone the event happened in.
126126
127127
return $converted;
128128
}
129+
130+
private static function getUtc()
131+
{
132+
return self::$utc ? self::$utc : self::$utc = new \DateTimeZone('UTC');
133+
}
129134
}
130135
131136
This database type makes sure that every DateTime instance is always saved in UTC, relative

0 commit comments

Comments
 (0)