[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
Tue Sep 1 16:35:08 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
--------------------------+------------------------------

Comment (by KestutisIT):

 Your advice does not solve my problem. I had to write this function on my
 own. I believe this is a bug in logic then and has to be discussed with
 seniors of Wordpress. This has to be left open and assigned for action
 from seniors. This HAS to be changed as I described, because it's an
 unexpected behavior.

 My workaround is bellow:


 {{{
         public function getPrintPickupDate()
         {
                 // WordPress bug
                 // BAD: return date_i18n(get_option('date_format'),
 $this->pickupTimestamp);
                 // OK: return date(get_option('date_format'),
 $this->pickupTimestamp + get_option( 'gmt_offset' ) * 3600);

                 // WordPress bug WorkAround
                 return date_i18n(get_option('date_format'),
 $this->pickupTimestamp + get_option( 'gmt_offset' ) * 3600, TRUE);
         }
 }}}

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


More information about the wp-trac mailing list