<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://heydon.com.au" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>My Projects</title>
 <link>http://heydon.com.au/myprojects/36</link>
 <description>My project menu</description>
 <language>en-NZ</language>
<item>
 <title>Drupal Dates in MySQL</title>
 <link>http://heydon.com.au/node/935</link>
 <description>
&lt;p&gt;Drupal stores all dates in the unix time format which is the number of seconds since the 1/1/1970. This is good because adding days, it easy, just add 86400 seconds, or you can use the strtotime().&lt;/p&gt;&lt;p&gt;When you are trying to access data directly from the MySQL database because it is not stored in a date field, it just appears as a number.&lt;/p&gt;&lt;p&gt;However there is a trick you can use in MySQL which will display this number as a date. You can use the FROM_UNIXTIME() which will convert the unix time to a MySQL date. So you can do something like&lt;/p&gt;&lt;code&gt;SELECT n.nid, FROM_UNIXTIME(n.created) FROM node n&lt;!--&lt;code--&gt;&lt;/code&gt;&lt;p&gt;This will display the created field as a date field. These times will be displayed in GMT, so you will still need to adjust it to your local time.&lt;br /&gt;&lt;/p&gt;</description>
 <comments>http://heydon.com.au/node/935#comments</comments>
 <category domain="http://heydon.com.au/taxonomy/term/36">tips</category>
 <pubDate>Mon, 08 May 2006 17:21:16 -0700</pubDate>
 <dc:creator>gordon</dc:creator>
 <guid isPermaLink="false">935 at http://heydon.com.au</guid>
</item>
</channel>
</rss>

