orisai / object-mapper

Raw data mapping to validated objects
Mozilla Public License 2.0
10 stars 1 forks source link

Parse datetime with ISO8601 format from JS (ending with Z) properly #34

Closed mabar closed 1 year ago

mabar commented 1 year ago

https://3v4l.org/ZiAI9

(new Date()).toISOString()
'2022-11-31T11:00:00.000Z'
$d = DateTimeImmutable::createFromFormat('Y-m-d\TH:i:s.v\Z', '2022-10-31T11:00:00.000Z', new \DateTimeZone('UTC'));
var_dump($d);
$d = $d->setTimezone(new \DateTimeZone('Europe/Prague'));
var_dump($d);
mabar commented 1 year ago

Solved by https://github.com/orisai/object-mapper/commit/81c714a5c3a96cb94426aa46506e2ed1fa47d928

github-actions[bot] commented 1 year ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.