Planet MySQL Planet MySQL: Meta Deutsch Español Français Italiano 日本語 Русский Português 中文
Showing entries 1 to 2

Displaying posts with tag: mysql millisecond (reset)

Glad to See Microsecond Support in both MariaDB and MySQL Now
+6 Vote Up -0Vote Down

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 “Fractional Seconds Handling” 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

  [Read more...]
Datetime & Timestamp manipulation / migration explained
+0 Vote Up -0Vote Down

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'); --> 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'); --> 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












  [Read more...]
Showing entries 1 to 2

Planet MySQL © 1995, 2014, Oracle Corporation and/or its affiliates   Legal Policies | Your Privacy Rights | Terms of Use

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.