Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

valtzu
Copy link
Contributor

@valtzu valtzu commented Sep 16, 2023

Q A
Branch? 6.3
Bug fix? yes
New feature? no
Deprecations? no
License MIT

As discussed in #51651 (comment), when a datetime object is created from unix timestamp, the timezone constructor argument is ignored as demonstrated in https://onlinephp.io/c/b07d1 and also mentioned in PHP documentation:

The $timezone parameter and the current timezone are ignored when the $datetime parameter either is a UNIX timestamp (e.g. @946684800) or specifies a timezone (e.g. 2010-01-28T15:00:00+02:00).

This change shouldn't break any existing logic, given the places where this time is used already include timezone in the date format string.

Changes in effect

  ------------- ------------------------------------ --------------------------- 
   Message       Trigger                              Next Run                   
  ------------- ------------------------------------ --------------------------- 
-  TestMessage   PeriodicalTrigger: every 2 seconds   2023-09-16T15:54:46+00:00  
+  TestMessage   PeriodicalTrigger: every 2 seconds   2023-09-16T18:54:46+03:00  
  ------------- ------------------------------------ --------------------------- 

@fabpot
Copy link
Member

fabpot commented Sep 16, 2023

Thank you @valtzu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants