[wp-trac] [WordPress Trac] #57035: Error in current_time() function when using timestamp and no value for gmt_offset

WordPress Trac noreply at wordpress.org
Tue Mar 28 14:20:47 UTC 2023


#57035: Error in current_time() function when using timestamp and no value for
gmt_offset
----------------------------+-----------------------
 Reporter:  Nick_theGeek    |       Owner:  audrasjb
     Type:  defect (bug)    |      Status:  reopened
 Priority:  normal          |   Milestone:  6.2
Component:  Date/Time       |     Version:  5.3
 Severity:  normal          |  Resolution:
 Keywords:  has-patch php8  |     Focuses:
----------------------------+-----------------------

Comment (by hellofromTonya):

 In [changeset:"55598" 55598]:
 {{{
 #!CommitTicketReference repository="" revision="55598"
 Date/Time: Revert [55054].

 This changeset introduced a regression for partial-hour timezones such as
 +05:30 UTC which is India and Sri Lanka. How? These timezones are in
 float. The change made in [55054] type casted them to integer which
 dropped the decimal for the partial-hour, making the time inaccurate. For
 example, +05:30 UTC (India and Sri Lanka)'s `'gmt_offset'` is `5.5`, but
 with the changeset, it was changed to `5`.

 Reverting the changeset restores the original state of `current_time()`
 and thus resolves the regression.

 Props reputeinfosystems, Rarst, hellofromTonya, desrosj, audrasjb,
 sergeybiryukov, costdev, priethor, francina, nekojonez, codingchicken,
 cbringmann.
 See #57035.
 Fixes #57998.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57035#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list