[wp-trac] [WordPress Trac] #37634: Wrong usage of $gmt parameter in date_i18n() in options-general.php

WordPress Trac noreply at wordpress.org
Thu Aug 11 12:35:39 UTC 2016


#37634: Wrong usage of $gmt parameter in date_i18n() in options-general.php
----------------------------------------+------------------------------
 Reporter:  swissspidy                  |       Owner:
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  Awaiting Review
Component:  Administration              |     Version:  3.1
 Severity:  normal                      |  Resolution:
 Keywords:  needs-patch good-first-bug  |     Focuses:
----------------------------------------+------------------------------

Comment (by jdgrimes):

 Actually, there is no difference between `date()` and `gmdate()` in
 WordPress, so that line can be removed. At the time WordPress was
 experimenting with setting the default PHP time based on the site's
 timezone, but in the end it was decided to just always have the default
 timezome be UTC/GMT. Which means that `date()` and `time()` always return
 UTC values, and thus using `gmdate()` is unnecessary. (I discovered this
 just the other day when I was researching a date/time-related bug in a
 plugin.) See #9588 and [12727].

 I'd suggest that every reference to `gmdate()` in core be changed to
 `date()` to avoid this confusion.

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


More information about the wp-trac mailing list