[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:20:47 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:
--------------------------------------+-----------------------------
Changes (by hellofromTonya):

 * owner:  (none) => hellofromTonya
 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 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/57998#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list