While modifying a plugin to work correctly in WP 2.5, I came across this code snippet.
I haven’t had to deal with it myself, but maybe someone else will find it useful, or hilarious as I did. Here’s the code to make timestamps WordPress friendly (apprently):
// Dealing with timestamps in WordPress is so fucking fucked.
$offset = (int) get_option('gmt_offset') * 60 * 60;
$this->post['post_date'] = gmdate('Y-m-d H:i:s', $this->published()
+ $offset);
$this->post['post_modified'] = gmdate('Y-m-d H:i:s',
$this->updated() + $offset);
$this->post['post_date_gmt'] = gmdate('Y-m-d H:i:s', $this->
published());
$this->post['post_modified_gmt'] = gmdate('Y-m-d H:i:s', $this->
updated());