[wp-trac] [WordPress Trac] #33624: date_i18n do not returns time in GMT even if GMT is set to false

WordPress Trac noreply at wordpress.org
Mon Aug 31 19:46:42 UTC 2015


#33624: date_i18n do not returns time in GMT even if GMT is set to false
--------------------------+------------------------------
 Reporter:  KestutisIT    |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Date/Time     |     Version:  4.3
 Severity:  normal        |  Resolution:
 Keywords:  close         |     Focuses:  ui
--------------------------+------------------------------
Changes (by johnbillion):

 * keywords:   => close


Comment:

 Thanks for the report, KestutisIT.

 The `$gmt` parameter in `date_i18n()` only operates if the
 `$unixtimestamp` parameter is boolean false, upon which the `$gmt`
 parameter gets passed to the `current_time()` function which returns the
 current time according to the timezone settings on the General Settings
 screen.

 Yes, this is an awful piece of design, and no, I have no idea why it's
 like this.

 You might be interested in using the `get_date_from_gmt()` function
 instead. [http://wordpress.stackexchange.com/a/107258/27051 Find out how
 to use it here].

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


More information about the wp-trac mailing list