[wp-trac] Re: [WordPress Trac] #7180: Feed item date is Nov 29, 1999 (bad post_date_gmt)

WordPress Trac wp-trac at lists.automattic.com
Fri Jul 25 16:36:57 GMT 2008


#7180: Feed item date is Nov 29, 1999 (bad post_date_gmt)
-----------------------------------------------------------------------------+
 Reporter:  dougal                                                           |        Owner:  anonymous
     Type:  defect                                                           |       Status:  new      
 Priority:  normal                                                           |    Milestone:  2.9      
Component:  General                                                          |      Version:  2.5.1    
 Severity:  normal                                                           |   Resolution:           
 Keywords:  rss, atom, feeds, timestamp, posts, post_date_gmt, 1999, nov 29  |  
-----------------------------------------------------------------------------+
Changes (by dougal):

 * cc: dougal (added)

Comment:

 Ticket #6483 might not *directly* apply, because I'm just using the web
 interface to post, not the API. However, it's possible (likely?) that the
 same underlying bug is at work here.

 I still haven't been able to reliably replicate the problem, though I
 haven't had a whole lot of time to test it, either. I do wonder if it
 could be a plugin side-effect. In particular, I have the 'Automatic
 Timezone' plugin installed. I don't think any of my other plugins would
 have any major interaction with timestamps or post saving.

 Just as an FYI for other people who find this ticket, if you want to fix
 the timestamps, try using a SQL query like so:

 `UPDATE wp_posts
   SET post_date_gmt = ADDTIME(post_date, '04:00:00')
   WHERE post_date_gmt = '0000-00-00 00:00:00'
     AND post_date <> '0000-00-00 00:00:00'
     AND post_status = 'publish';`

 In this case, we're assuming that you are in the EDT (GMT -04:00)
 timezone, so we're adding 4 hours back to the post_date to calculate
 post_date_gmt. Adust the '04:00:00' value accordingly for your timezone.
 If you are east of the international date line (positive GMT offset), then
 use the SUBTIME() function instead of ADDTIME().

 Also, it doesn't take Daylight Savings into acccount, so if you have posts
 that were affected before and after a time change, you might want to add
 appropriate WHERE clauses and run two queries with the different
 adjustments.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/7180#comment:3>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list