<?xml version="1.0" ?>
<rss version="2.0">
	<channel>
		<title>Keith's Weblog: Comments on &quot;Storing times in MySQL&quot;</title>
		<description>Keith's Weblog: Comments on &quot;Storing times in MySQL&quot;, posted on July 15, 2004</description>
		<link>http://keithdevens.com/weblog/archive/2004/Jul/15/MySQL.time</link>

		<category>Programming</category>
		<category>This website</category>
		<language>en-us</language>
		<image>
			<link>http://keithdevens.com/weblog</link>
			<title>Keith Devens .com</title>
			<url>http://keithdevens.com/images/kbd.gif</url>
		</image>

		<item>
			<title>by jason</title>
			<link>http://keithdevens.com/weblog/archive/2004/Jul/15/MySQL.time#comment5011</link>
			<guid isPermaLink="false">http://keithdevens.com/weblog/5011#comment5011</guid>
			<pubDate>Thu, 15 Jul 2004 23:40:44 +0000</pubDate>
			<description>&lt;p class=&quot;st-markup&quot;&gt;I wouldn't bother storing the timezone unless there was a good reason.  Store the UTC time, and then apply the timezone of the user viewing the dates/times.&lt;/p&gt;

&lt;p class=&quot;st-markup&quot;&gt;If you wrote something at 3pm localtime, do I care.  If I am 3hours ahead it might be nicer to see that you wrote it at 6pm my localtime.  If I was comparing lots of different events by people in different timezones, having things in my local timezone would be nicer than seeing what time each individual did things in their timezone.&lt;/p&gt;

</description>
		</item>
		<item>
			<title>by Keith</title>
			<link>http://keithdevens.com/weblog/archive/2004/Jul/15/MySQL.time#comment5020</link>
			<guid isPermaLink="false">http://keithdevens.com/weblog/5011#comment5020</guid>
			<pubDate>Fri, 16 Jul 2004 00:42:58 +0000</pubDate>
			<description>&lt;p class=&quot;st-markup&quot;&gt;Well, here's one reason. I'd like to know what time things were done in my localtime. Given daylight savings time, if I only store GMT, I won't really know what time, localtime, things were done unless I also check to see if DST was in effect in code.&lt;/p&gt;

&lt;p class=&quot;st-markup&quot;&gt;Another example is that if I move to a different time zone I'd like to have my new blog times change to my new localtime but leave the old ones the same.&lt;/p&gt;

&lt;p class=&quot;st-markup&quot;&gt;One of the things that's kind of freaking me out is this: my permalinks are based on my localtime posting. The official date for this post is July 15 and that's the date in the permalink. If I was in Sri Lanka (or wherever), my post might have been on July 16th. What if it's May 1 here and I travel to a different time zone and post something on April 30 (their) localtime? It makes me want to organize my weblog only according to GMT to avoid stuff like that, but then it won't reflect what time I'm actually living in.&lt;/p&gt;

&lt;p class=&quot;st-markup&quot;&gt;Being able to treat MySQL dates &lt;em&gt;as&lt;/em&gt; dates and storing them in datetime format like WordPress does is looking more and more attractive.&lt;/p&gt;

</description>
		</item>
		<item>
			<title>by Keith</title>
			<link>http://keithdevens.com/weblog/archive/2004/Jul/15/MySQL.time#comment5021</link>
			<guid isPermaLink="false">http://keithdevens.com/weblog/5011#comment5021</guid>
			<pubDate>Fri, 16 Jul 2004 00:55:33 +0000</pubDate>
			<description>&lt;p class=&quot;st-markup&quot;&gt;Here's someone else thinking along these lines:&lt;br /&gt;
&lt;a href=&quot;http://www.gyford.com/phil/writing/2003/08/21/movable_type_tim.php&quot;&gt;http://www.gyford.com/phil/writing/2003/08/21/movable_type_tim.php&lt;/a&gt;&lt;/p&gt;

&lt;p class=&quot;st-markup&quot;&gt;&lt;a href=&quot;http://webexhibits.org/daylightsaving/g.html&quot;&gt;Daylight savings time&lt;/a&gt; is another, smaller, issue.&lt;/p&gt;

</description>
		</item>
		<item>
			<title>by Keith</title>
			<link>http://keithdevens.com/weblog/archive/2004/Jul/15/MySQL.time#comment5024</link>
			<guid isPermaLink="false">http://keithdevens.com/weblog/5011#comment5024</guid>
			<pubDate>Fri, 16 Jul 2004 02:23:20 +0000</pubDate>
			<description>&lt;p class=&quot;st-markup&quot;&gt;Here's a neat &lt;a href=&quot;http://cheerleader.yoz.com/archives/000506.html&quot;&gt;post&lt;/a&gt; that seems worth mentioning.&lt;/p&gt;

</description>
		</item>
		<item>
			<title>by Matt</title>
			<link>http://keithdevens.com/weblog/archive/2004/Jul/15/MySQL.time#comment5028</link>
			<guid isPermaLink="false">http://keithdevens.com/weblog/5011#comment5028</guid>
			<pubDate>Sun, 18 Jul 2004 23:37:45 +0000</pubDate>
			<description>&lt;p class=&quot;st-markup&quot;&gt;We struggled with this quite a bit and had a couple of failed attempts before we came up with the current method in WP. I'm pretty happy with the robustness of the data and the way it makes it easy to work with things. However our reliance on the MySQL date functions makes the WordPress application very hard to port to other databases.&lt;/p&gt;

</description>
		</item>
		<item>
			<title>by Keith</title>
			<link>http://keithdevens.com/weblog/archive/2004/Jul/15/MySQL.time#comment5029</link>
			<guid isPermaLink="false">http://keithdevens.com/weblog/5011#comment5029</guid>
			<pubDate>Mon, 19 Jul 2004 04:08:03 +0000</pubDate>
			<description>&lt;p class=&quot;st-markup&quot;&gt;Thanks Matt. I'm most likely going to follow your lead here. I probably wouldn't have thought of doing it that way if I hadn't seen WordPress do it first. Incidentally, when I was writing this post I looked back on your reply to the e-mail I sent you asking about this. Thanks for all the insight.&lt;/p&gt;

&lt;p class=&quot;st-markup&quot;&gt;And, portability is much more of a concern for you with WP because it's software that other people use. My software's just for me so I have the luxury of not worrying about hassles like portability if I don't want to. &lt;img class=&quot;smiley&quot; src=&quot;/images/smiley_side.gif&quot; alt=&quot;Smiley&quot; /&gt;&lt;/p&gt;

</description>
		</item>
		<item>
			<title>by Keith</title>
			<link>http://keithdevens.com/weblog/archive/2004/Jul/15/MySQL.time#comment5032</link>
			<guid isPermaLink="false">http://keithdevens.com/weblog/5011#comment5032</guid>
			<pubDate>Mon, 19 Jul 2004 15:11:23 +0000</pubDate>
			<description>&lt;p class=&quot;st-markup&quot;&gt;It appears Dunstan has &lt;a href=&quot;http://www.1976design.com/blog/archive/2004/07/17/version-2/&quot;&gt;used the same scheme&lt;/a&gt; in the new version of his weblog (search for &amp;quot;Post times&amp;quot;).&lt;/p&gt;

</description>
		</item>
		<item>
			<title>by 161.142.148.211</title>
			<link>http://keithdevens.com/weblog/archive/2004/Jul/15/MySQL.time#comment6964</link>
			<guid isPermaLink="false">http://keithdevens.com/weblog/5011#comment6964</guid>
			<pubDate>Fri, 04 Feb 2005 10:47:12 +0000</pubDate>
			<description>&lt;p class=&quot;st-markup&quot;&gt;I'm hosting mysql outside of my country and my question how do I store date into database for current date + date into the database but using my country current time, and my country localtime is GMT+8&lt;/p&gt;

</description>
		</item>
	</channel>
</rss>
