[2.3][Form] Removed UTC specification with timestamp#18821
Merged
nicolas-grekas merged 1 commit intosymfony:2.3from May 30, 2016
Merged
[2.3][Form] Removed UTC specification with timestamp#18821nicolas-grekas merged 1 commit intosymfony:2.3from
nicolas-grekas merged 1 commit intosymfony:2.3from
Conversation
| 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')); |
Member
There was a problem hiding this comment.
is it better? any benefit?
Contributor
Author
There was a problem hiding this comment.
@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! 👍
Member
|
👍 |
Member
|
Thank you @francisbesset. |
nicolas-grekas
added a commit
that referenced
this pull request
May 30, 2016
<
8000
/div>
…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
Merged
This was referenced Jun 6, 2016
Merged
Merged
Merged
Merged
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

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!