-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[2.3][Form] Removed UTC specification with timestamp #18821
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
Conversation
@@ -126,7 +126,7 @@ public function reverseTransform($value) | |||
|
|||
try { | |||
// read timestamp into DateTime object - the formatter delivers in UTC | |||
$dateTime = new \DateTime(sprintf('@%s UTC', $timestamp)); | |||
$dateTime = new \DateTime(sprintf('@%s', $timestamp), new \DateTimeZone('UTC')); |
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.
is it better? any benefit?
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.
@nicolas-grekas After bench, the usage of a DateTimeZone is slower 👎
But the function date_parse()
indicates a warning if a timezone is used with the timestamp: Double timezone specification
. I removed the UTC specification and this time it's more faster! 👍
👍 |
Thank you @francisbesset. |
…cisbesset) This PR was merged into the 2.3 branch. Discussion ---------- [2.3][Form] Removed UTC specification with timestamp | Q | A | ------------- | --- | Branch? | 2.3 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a The function `date_parse()` indicates a warning if a timezone is used with the timestamp: `Double timezone specification`. I removed the UTC specification and this time it's more faster! Commits ------- 0d14aac Removed UTC specification with timestamp
The function
date_parse()
indicates a warning if a timezone is used with the timestamp:Double timezone specification
. I removed the UTC specification and this time it's more faster!