-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Yaml] Support parsing YAML timestamps as DateTime #14420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
238589d
Add $objectForMap as argument of Yaml::parse()
remi-blaise 3daae64
[Yaml] Add an option to parse timestamps as DateTime
remi-blaise 9db5c6f
[Yaml] Add DateTime support to the Dumper
remi-blaise 663a9ca
[Yaml] Dump human-readable timestamps
remi-blaise 41c5f12
[Yaml] Depreciate to not use DateTime
remi-blaise dd4798e
Worship fabbot.io
remi-blaise 1f4269e
[Yaml] Accept DateTimeImmutable instances
remi-blaise 028f2d7
[Yaml] Delete a cast
remi-blaise 5d75dd0
[Yaml] Prepare merging in 2.8 rather than 2.7
remi-blaise 72abdee
[Yaml] Rename $dateTimeSupport argument as $timestampAsDateTime
remi-blaise 1b970f3
[Yaml] Fix deprecation
remi-blaise 422d838
[Yaml] Fix usage of $timestampAsDateTime
remi-blaise File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev
Previous commit
[Yaml] Fix usage of $timestampAsDateTime
- Loading branch information
commit 422d8380da82b0434193c555d87f1c35c0978848
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this. The code parsing the date might have a different default timezone. It is better to always include all info IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, if the TimeZone has been intentionally defined as for exemple +1 (in the YAML file parsed or in the PHP datas), it dumps it (because the server server timestamp is for example Europe/Paris and not +1).
If it was not defined manually, it has the default TimeZone and so the Yaml component doesn't dump the timestamp (letting it with default value in some ways).
I think personally it's the best behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if it was explicitly defined as UTC and the server default timezone is also UTC ? You have no way to know whether the UTC timezone was explicitly chosen or no. But even worse, you have no idea how this will be parsed. So IMO, you should not drop information when dumping, assuming that the server parsing your YAML will have the same config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.