[wp-trac] [WordPress Trac] #34835: date_i18n() produces invalid output for numerical time zones

WordPress Trac noreply at wordpress.org
Tue Apr 19 11:56:33 UTC 2016


#34835: date_i18n() produces invalid output for numerical time zones
--------------------------+------------------------------
 Reporter:  Rarst         |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Date/Time     |     Version:  3.1
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+------------------------------

Comment (by pbearne):

 in the code, we test for if the option is empty/false and ship the use if
 it is

 {{{#!php
 <?php
 $timezone_string = get_option( 'timezone_string' );
 if ( $timezone_string ) {....
 }}}

 So it doesn't error but it doesn't return a date with the offset

 the problem is that you can have a more than one time zone for more than
 one offset and the summer/winter time changes are per timezone no offset.

 There is a mapping from time zone to offset but not from offset to time
 zone as don't know which time zone to set

 Maybe the need to discourage the setting of the offset in the options and
 that way always have a timezone.

 The default enter for get_option( 'timezone_string' ) is emtpy not even
 GMT

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


More information about the wp-trac mailing list