[wp-trac] [WordPress Trac] #9588: time() is not GMT time()

WordPress Trac wp-trac at lists.automattic.com
Thu Sep 24 16:11:50 UTC 2009


#9588: time() is not GMT time()
--------------------------------+-------------------------------------------
  Reporter:  Denis-de-Bernardy  |        Type:  defect (bug)             
    Status:  reopened           |    Priority:  normal                   
 Milestone:                     |   Component:  Date/Time                
   Version:  2.8                |    Severity:  normal                   
Resolution:                     |    Keywords:  needs-patch needs-testing
--------------------------------+-------------------------------------------

Comment(by Denis-de-Bernardy):

 attached is a picture of a calendar bug:

 http://core.trac.wordpress.org/attachment/ticket/9588/Picture%201.png

 The two dumps are in the get_calendar() function:

 {{{
         dump($unixmonth, date('Y-m-d', $unixmonth));
         // Get days with posts
         $dayswithposts = $wpdb->get_results("SELECT DISTINCT
 DAYOFMONTH(post_date)
                 FROM $wpdb->posts WHERE MONTH(post_date) = '$thismonth'
                 AND YEAR(post_date) = '$thisyear'
                 AND post_type = 'post' AND post_status = 'publish'
                 AND post_date < '" . current_time('mysql') . '\'',
 ARRAY_N);
         if ( $dayswithposts ) {
                 foreach ( (array) $dayswithposts as $daywith ) {
                         $daywithpost[] = $daywith[0];
                 }
         } else {
                 $daywithpost = array();
         }
         dump($unixmonth, date('Y-m-d', $unixmonth));
 }}}

 The laptop is using the CEST timezone vs the site's EST timezone.

 I'm nailing this down to the wp_timezone_override_offset() function.
 Probably, if not certainly:

 {{{
 @date_default_timezone_set( $timezone_string );
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/9588#comment:13>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list