我有一个类型为 DATETIME
的列。它似乎以日期和时间存储数据,但不是以毫秒为单位。
我还能做些什么来确保另外捕获毫秒数?
例子:
insert into mytable (datecreated) values (now());
select * from mutable; -- fetches 2014-10-06 17:44:19 date followed by hr:min:sec but not millisecond
最佳答案
http://dev.mysql.com/doc/refman/5.0/en/datetime.html 但是,微秒不能存储到任何时间数据类型的列中。任何微秒部分都将被丢弃。
您可以将日期存储为字符串。
关于mysql - 如何在mysql中获取毫秒数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26225729/