[wp-trac] [WordPress Trac] #57998: current_time function: GMT offset is not always an integer

WordPress Trac noreply at wordpress.org
Tue Mar 28 14:32:57 UTC 2023


#57998: current_time function: GMT offset is not always an integer
--------------------------------------+-----------------------------
 Reporter:  reputeinfosystems         |       Owner:  hellofromTonya
     Type:  defect (bug)              |      Status:  closed
 Priority:  normal                    |   Milestone:  6.2
Component:  Date/Time                 |     Version:  trunk
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+-----------------------------

Comment (by hellofromTonya):

 In [changeset:"55599" 55599]:
 {{{
 #!CommitTicketReference repository="" revision="55599"
 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.
 Reviewed by desrosj.
 Merges [55598] to the 6.2 branch.
 See #57035.
 Fixes #57998.
 }}}

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


More information about the wp-trac mailing list