Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #22444 [Serializer] DateTimeNormalizer: allow to provide time…
…zone (ogizanagi) This PR was merged into the 3.4 branch. Discussion ---------- [Serializer] DateTimeNormalizer: allow to provide timezone | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | N/A | License | MIT | Doc PR | N/A My own use-case was for denormalization of a csv file provided by a third-party. The datetime format inside does not contain any timezone information, and won't change, but it's established to be UTC (or at least consistent). So by providing the new `datetime_timezone` option, the returned instance of `\DateTime(Interface)` will properly be set with the expected timezone. (In case the format already supports the time offset, the provided timezone is ignored in favor of the one parsed by the `\DateTime` object) Regarding normalization, the expected behavior of this feature is to consistently return the same time offset. Commits ------- c10a780 [Serializer] DateTimeNormalizer: allow to provide timezone
- Loading branch information
Showing
2 changed files
with
106 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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