<?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/"
	>

<channel>
	<title>PlanetMysql.ru - информация о СУБД MySQL &#187; mysql millisecond</title>
	<atom:link href="http://planetmysql.ru/category/mysql-millisecond/feed/" rel="self" type="application/rss+xml" />
	<link>http://planetmysql.ru</link>
	<description>Блог о самой популярной СУБД MySQL</description>
	<lastBuildDate>Thu, 24 May 2012 22:24:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Glad to See Microsecond Support in both MariaDB and MySQL Now</title>
		<link>http://www.chriscalender.com/?p=509&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=glad-to-see-microsecond-support-in-both-mariadb-and-mysql-now</link>
		<comments>http://www.chriscalender.com/?p=509#comments</comments>
		<pubDate>Thu, 08 Dec 2011 00:56:33 +0000</pubDate>
		<dc:creator>Chris Calender</dc:creator>
				<category><![CDATA[MariaDB fractional second]]></category>
		<category><![CDATA[mariadb microsecond]]></category>
		<category><![CDATA[MariaDB millisecond]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[MySQL fractional second]]></category>
		<category><![CDATA[mysql microsecond]]></category>
		<category><![CDATA[mysql millisecond]]></category>

		<guid isPermaLink="false">http://www.chriscalender.com/?p=509</guid>
		<description><![CDATA[As you may or may not know, MariaDB has supported microseconds in version 5.3 for several months already.
And now MySQL has added microsecond support in version 5.6 (5.6.4, specifically).
For more details on MariaDB microseconds, please refer to this page:
http://kb.askmonty.org/en/microseconds-in-mariadb
And for more details on MySQL microseconds, see &#8220;Fractional Seconds Handling&#8221; on the following page:
http://dev.mysql.com/doc/refman/5.6/en/news-5-6-4.html
From what I can tell, the implementation looks largely to be the same (at least from a user perspective), in that if the fractional part is given, it must be an integer number 0 to 6.  And if no precision is given, the default is 0, for backward compatibility.
MySQL 5.6 is still in the &#8220;Development&#8221; phase, and MariaDB 5.3 is in the &#8220;Beta&#8221; phase, so I&#8217;d expect MariaDB 5.3 to be GA first, but that&#8217;s just a guesstimate on my part.]]></description>
			<content:encoded><![CDATA[<p>As you may or may not know, MariaDB has <a href="http://www.chriscalender.com/?p=363">supported microseconds</a> in version 5.3 for several months already.</p>
<p>And now MySQL has added microsecond support in version 5.6 (5.6.4, specifically).</p>
<p>For more details on MariaDB microseconds, please refer to this page:</p>
<p><a href="http://kb.askmonty.org/en/microseconds-in-mariadb">http://kb.askmonty.org/en/microseconds-in-mariadb</a></p>
<p>And for more details on MySQL microseconds, see &#8220;Fractional Seconds Handling&#8221; on the following page:</p>
<p><a href="http://dev.mysql.com/doc/refman/5.6/en/news-5-6-4.html">http://dev.mysql.com/doc/refman/5.6/en/news-5-6-4.html</a></p>
<p>From what I can tell, the implementation looks largely to be the same (at least from a user perspective), in that if the fractional part is given, it must be an integer number 0 to 6.  And if no precision is given, the default is 0, for backward compatibility.</p>
<p>MySQL 5.6 is still in the &#8220;Development&#8221; phase, and MariaDB 5.3 is in the &#8220;Beta&#8221; phase, so I&#8217;d expect MariaDB 5.3 to be GA first, but that&#8217;s just a guesstimate on my part.</p><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=31157&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=31157&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://planetmysql.ru/2011/12/08/glad-to-see-microsecond-support-in-both-mariadb-and-mysql-now/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Datetime &amp; Timestamp manipulation / migration explained</title>
		<link>http://mysqlpreacher.com/wordpress/2010/06/datetime-timestamp-manipulation-migration-explained/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=datetime-timestamp-manipulation-migration-explained</link>
		<comments>http://mysqlpreacher.com/wordpress/2010/06/datetime-timestamp-manipulation-migration-explained/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 16:47:16 +0000</pubDate>
		<dc:creator>Darren Cassar</dc:creator>
				<category><![CDATA[advanced]]></category>
		<category><![CDATA[datetime]]></category>
		<category><![CDATA[date_format]]></category>
		<category><![CDATA[Intermediate]]></category>
		<category><![CDATA[microsecond]]></category>
		<category><![CDATA[migrating to mysql]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[millisecond]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql millisecond]]></category>
		<category><![CDATA[str_to_date]]></category>
		<category><![CDATA[timstamp]]></category>

		<guid isPermaLink="false">http://mysqlpreacher.com/wordpress/?p=351</guid>
		<description><![CDATA[Are you doing some datetime manipulation or maybe you are migrating from some database technology to MySQL or possibly using milliseconds?
Here is an example on how to go about it:
Say you have the following date: MAR 16 2008 09:12:51:893AM
SELECT DATE_FORMAT(STR_TO_DATE('MAR 16 2008 09:12:51:893AM','%M %d %Y %h:%i:%s:%f%p'),'%Y%m%d%k%i%s.%f'); --&#62; 2008031691251.893000

What if its PM rather than AM
SELECT DATE_FORMAT(STR_TO_DATE('MAR 16 2008 09:12:51:893PM','%M %d %Y %h:%i:%s:%f%p'),'%Y%m%d%k%i%s.%f'); --&#62; 20080316211251.893000

Ok so this is just simple string manipulation where:
%M is the month name
%d is day number
%Y is the year
%h is the hour
%i is the minute
%s is the second
%f is the microsecond
%p is the period: ante or post meridiem
In the DATE_FORMAT part we se a %k which is in 24hr format in order to loose the period.
A more detailed list is found here
Here is a demo:
mysql Tue Jun 15 12:32:37 2010 &#62; CREATE TABLE test.abc(a DECIMAL(17,3)) ENGINE=MYISAM;
Query OK, 0 rows affected (0.03 sec)
mysql Tue Jun 15 12:32:45 2010 &#62; INSERT INTO abc VALUES ( DATE_FORMAT(STR_TO_DATE('MAR 16 2008 09:12:51:893PM','%M %d %Y %h:%i:%s:%f%p'),'%Y%m%d%k%i%s.%f') );
Query OK, 1 row affected (0.01 sec)
mysql Tue Jun 15 12:32:51 2010 &#62; SELECT * FROM abc;
+--------------------+
&#124; a                  &#124;
+--------------------+
&#124; 20080316211251.893 &#124;
+--------------------+
1 row in set (0.00 sec)

mysql Tue Jun 15 12:32:56 2010 &#62; SELECT TIMESTAMP(a) FROM abc;
+----------------------------+
&#124; TIMESTAMP(a)               &#124;
+----------------------------+
&#124; 2008-03-16 21:12:51.893000 &#124;
+----------------------------+
1 row in set (0.00 sec)]]></description>
			<content:encoded><![CDATA[<p>Are you doing some datetime manipulation or maybe you are migrating from some database technology to MySQL or possibly using milliseconds?<br />
Here is an example on how to go about it:</p>
<p>Say you have the following date: MAR 16 2008 09:12:51:893AM<br />
<code>SELECT DATE_FORMAT(STR_TO_DATE('MAR 16 2008 09:12:51:893AM','%M %d %Y %h:%i:%s:%f%p'),'%Y%m%d%k%i%s.%f'); --&gt; 2008031691251.893000<br />
</code></p>
<p>What if its PM rather than AM<br />
<code>SELECT DATE_FORMAT(STR_TO_DATE('MAR 16 2008 09:12:51:893PM','%M %d %Y %h:%i:%s:%f%p'),'%Y%m%d%k%i%s.%f'); --&gt; 20080316211251.893000<br />
</code></p>
<p>Ok so this is just simple string manipulation where:<br />
<code>%M is the month name<br />
%d is day number<br />
%Y is the year<br />
%h is the hour<br />
%i is the minute<br />
%s is the second<br />
%f is the microsecond<br />
%p is the period: ante or post meridiem</code><br />
In the DATE_FORMAT part we se a %k which is in 24hr format in order to loose the period.</p>
<p>A more detailed list is found <a href="http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date-format" >here</a></p>
<p>Here is a demo:</p>
<p><code>mysql Tue Jun 15 12:32:37 2010 &gt; CREATE TABLE test.abc(a DECIMAL(17,3)) ENGINE=MYISAM;<br />
Query OK, 0 rows affected (0.03 sec)</code></p>
<p><code>mysql Tue Jun 15 12:32:45 2010 &gt; INSERT INTO abc VALUES ( DATE_FORMAT(STR_TO_DATE('MAR 16 2008 09:12:51:893PM','%M %d %Y %h:%i:%s:%f%p'),'%Y%m%d%k%i%s.%f') );<br />
Query OK, 1 row affected (0.01 sec)</code></p>
<p><code>mysql Tue Jun 15 12:32:51 2010 &gt; SELECT * FROM abc;<br />
+--------------------+<br />
| a                  |<br />
+--------------------+<br />
| 20080316211251.893 |<br />
+--------------------+<br />
1 row in set (0.00 sec)</p>
<p></code></p>
<p><code>mysql Tue Jun 15 12:32:56 2010 &gt; SELECT TIMESTAMP(a) FROM abc;<br />
+----------------------------+<br />
| TIMESTAMP(a)               |<br />
+----------------------------+<br />
| 2008-03-16 21:12:51.893000 |<br />
+----------------------------+<br />
1 row in set (0.00 sec)</code></p><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25032&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25032&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://planetmysql.ru/2010/06/15/datetime-timestamp-manipulation-migration-explained/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

