How to deal with dates and timestamps in WordPress
Tuesday, September 25th, 2007$post[‘post_date’] = date(‘Y-m-d H:i:s’, (!is_null($post[‘epoch’][‘issued’]) ? $post[‘epoch’][‘issued’] : $post[‘epoch’][‘modified’])); $post[‘post_modified’] = date(‘Y-m-d H:i:s’, $post[‘epoch’][‘modified’]); $post[‘post_date_gmt’] = gmdate(‘Y-m-d H:i:s’, (!is_null($post[‘epoch’][‘issued’]) ? $post[‘epoch’][‘issued’] : $post[‘epoch’][‘modified’])); $post[‘post_modified_gmt’] = gmdate(‘Y-m-d H:i:s’, $post[‘epoch’][‘modified’]); $guid = $post[‘guid’]; $result = $wpdb->get_row(” SELECT id, guid, UNIX_TIMESTAMP(post_modified) AS modified FROM $wpdb->posts WHERE guid=’$guid’ “); if (!$result) : $freshness = 2; // New content elseif […]
