[wp-trac] [WordPress Trac] #48675: mysql2date adding timezone offset when given GMT time

WordPress Trac noreply at wordpress.org
Sat Nov 16 21:14:26 UTC 2019


#48675: mysql2date adding timezone offset when given GMT time
--------------------------+-----------------------------
 Reporter:  lisota        |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Date/Time     |    Version:  5.3
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Recent changes to mysql2date seem to have introduced a timezone bug
 offset.

 I am seeing this in lastbuilddate in RSS feeds which uses
 get_feed_build_date(). get_feed_build_date() retrieves a set of modified
 times from the database in GMT format.

 Then it sends the latest one to mysql2date for formatting with 'r' as the
 chosen format. mysql2date is adding a timezone offset with the
 wp_timezone() function.

 The result in the RSS feed is a GMT time with an incorrect timezone offset
 (should be +0), based on the timezone set in WP admin.

 In our case, our WP timezone is -8. RSS validation fails because the
 lastbuildtime is up to 8 hours in the future.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/48675>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list