-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Closed
Closed
Copy link
Description
Description
At present the Yaml component will parse date formats such as 2023-01-08T16:18:25.213Z but it can't dump them, instead only using the 'c' format which doesn't contain milliseconds. I would like to suggest having Inline use 'Y-m-d\TH:i:s.vO' and 'Y-m-d\TH:i:s.uO' instead when the DateTimeInterface object being dumped contains milliseconds or microseconds respectively. It wouldn't require any additional flags but instead have it intelligently choose which format to output based on how precise the DateTimeInterface is.
Example
Currently
In:
date: 2023-01-08T16:18:25Z
date_with_milliseconds: 2023-01-08T16:18:25.213Z
date_with_microseconds: 2023-01-08T16:18:25.718800ZOut:
date: 2023-01-08T16:18:25+00:00
date_with_milliseconds: 2023-01-08T16:18:25+00:00
date_with_microseconds: 2023-01-08T16:18:25+00:00Suggested
In:
date: 2023-01-08T16:18:25Z
date_with_milliseconds: 2023-01-08T16:18:25.213Z
date_with_microseconds: 2023-01-08T16:18:25.718800ZOut:
date: 2023-01-08T16:18:25+00:00
date_with_milliseconds: 2023-01-08T16:18:25.213+00:00
date_with_microseconds: 2023-01-08T16:18:25.718800+00:00