<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>domas mituzas &#187; time</title>
	<atom:link href="http://dom.as/tag/time/feed/" rel="self" type="application/rss+xml" />
	<link>http://dom.as</link>
	<description></description>
	<lastBuildDate>Thu, 02 Feb 2012 21:29:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='dom.as' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/6e344c6e0cd7462eb056f8b98eb2cbcd?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>domas mituzas &#187; time</title>
		<link>http://dom.as</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://dom.as/osd.xml" title="domas mituzas" />
	<atom:link rel='hub' href='http://dom.as/?pushpress=hub'/>
		<item>
		<title>How did the Sunday go?</title>
		<link>http://dom.as/2008/10/27/mysql-dst-issues/</link>
		<comments>http://dom.as/2008/10/27/mysql-dst-issues/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 14:31:00 +0000</pubDate>
		<dc:creator>Domas Mituzas</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[consistency]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://dammit.lt/?p=234</guid>
		<description><![CDATA[Yesterday Europe switched the daylight saving time. Though for most people thats a great change (you can sleep one hour longer, you&#8217;re not late for one day in whole year, etc), thats a data nightmare&#8230; Same time happens twice Time &#8230; <a href="http://dom.as/2008/10/27/mysql-dst-issues/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dom.as&amp;blog=190075&amp;post=234&amp;subd=domasmituzas&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Yesterday Europe switched the daylight saving time. Though for most people thats a great change (you can sleep one hour longer, you&#8217;re not late for one day in whole year, etc), thats a data nightmare&#8230;</p>
<ul>
<li>Same time happens twice</li>
<li>Time is not sequential value</li>
<li>Criteria for time gets fuzzy</li>
</ul>
<p>So, if you are using local time, instead of UTC, your data may hit unique constraints (if anyone has unique constraints on datetimes, of course ;-), or simply you won&#8217;t be able to detect which moment of time it refers to (bad for audit trails!)</p>
<p>The fun part within MySQL is that DATETIME is time-zone agnostic (it just stores presentation values), whereas TIMESTAMP is not (it stores data in UTC and presents it based on session timezone), so the behaviors for these will be different.</p>
<p>How different? DATETIME will just have non-sequential lossy information, and TIMESTAMP will have&#8230; depends. If implicit TIMESTAMP default values are used, it will have correct UTC-based data. If NOW() or literals are inserted, that will provide with lossy presentation-time based values. In order for database to actually understand what literal value means, it would ned an offset included (&#8220;hh:mm:ss+hhmm&#8221;) in the string (though MySQL currently does not support this notation). NOW() behavior is probably <a href='http://bugs.mysql.com/bug.php?id=38457'>a bug</a>.</p>
<p>Storing time correctly opens another can of worms &#8211; user-provided time criteria cannot be converted into UTC, and therefore a lossy match is done. To complicate things even more, as indexes are in sequential time, but data matching is done based on non-sequential time, data returned will be different based on data access method (see <a href='http://bugs.mysql.com/bug.php?id=38455'>Bug#38455</a>).</p>
<p>So, the elegant fix for timezone support inside MySQL would be extending the presentation/literal format to support specified offsets, fixing datetime/timestamp code in multiple places &#8211; and that would quite some work to fix one hour per year.</p>
<p>Timezone support is my old interest, there&#8217;s lots of complexity and different implications, but most of people just don&#8217;t get to that &#8211; and may lose their data consistency.</p>
<p>So, how did your Sunday go?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/domasmituzas.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/domasmituzas.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/domasmituzas.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/domasmituzas.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/domasmituzas.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/domasmituzas.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/domasmituzas.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/domasmituzas.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/domasmituzas.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/domasmituzas.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/domasmituzas.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/domasmituzas.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/domasmituzas.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/domasmituzas.wordpress.com/234/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dom.as&amp;blog=190075&amp;post=234&amp;subd=domasmituzas&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dom.as/2008/10/27/mysql-dst-issues/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c660a6eb3a4005232acb111303bef12c?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=G" medium="image">
			<media:title type="html">domasmituzas</media:title>
		</media:content>
	</item>
		<item>
		<title>2005: year one second longer</title>
		<link>http://dom.as/2005/12/29/2005-year-one-second-longer/</link>
		<comments>http://dom.as/2005/12/29/2005-year-one-second-longer/#comments</comments>
		<pubDate>Thu, 29 Dec 2005 10:07:47 +0000</pubDate>
		<dc:creator>Domas Mituzas</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://dammit.lt/?p=14</guid>
		<description><![CDATA[Instead of celebrating 2006, I&#8217;ll better choose to celebrate leap second &#8211; last time it happened in 1998. That is the second of total freedom, it is not accounted usually in budgets, calendars or anywhere else. It is announced 6 &#8230; <a href="http://dom.as/2005/12/29/2005-year-one-second-longer/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dom.as&amp;blog=190075&amp;post=14&amp;subd=domasmituzas&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Instead of celebrating 2006, I&#8217;ll better choose to celebrate <a href='http://en.wikipedia.org/wiki/Leap_second' title='leap second'>leap second</a> &#8211; last time it happened in 1998. That is the second of total freedom, it is not accounted usually in budgets, calendars or anywhere else. It is <a href='http://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat'>announced</a> 6 months before it happens. </p>
<p>On the other hand, you can make those leap seconds happen every year. All you have to do is sit on your office chairs and rotate counter-clockwise. Every rotation will shorten the day by 10<sup>-35</sup>s.  This has to happen in northern hemisphere of course, southerners should rotate clockwise.</p>
<p>And here is the important part, when will those free seconds happen:</p>
<ul>
<li>Helsinki, Vilnius, Cairo: 2005-12-31 21:59:60</li>
<li>Paris, Berlin: 2005-12-31 22:59:60</li>
<li>UTC: 2005-12-31 23:59:60</li>
</ul>
<p>So, synchronize your clocks, let&#8217;s have some free time!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/domasmituzas.wordpress.com/14/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/domasmituzas.wordpress.com/14/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/domasmituzas.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/domasmituzas.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/domasmituzas.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/domasmituzas.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/domasmituzas.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/domasmituzas.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/domasmituzas.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/domasmituzas.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/domasmituzas.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/domasmituzas.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/domasmituzas.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/domasmituzas.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/domasmituzas.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/domasmituzas.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dom.as&amp;blog=190075&amp;post=14&amp;subd=domasmituzas&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dom.as/2005/12/29/2005-year-one-second-longer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c660a6eb3a4005232acb111303bef12c?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=G" medium="image">
			<media:title type="html">domasmituzas</media:title>
		</media:content>
	</item>
	</channel>
</rss>
