简体   繁体   中英

How to get milliseconds in mysql

I have a column with DATETIME type. It seems to be storing data in date and time but not in milliseconds.

What can I do to ensure milliseconds are captured in addition?

Example:

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 However, microseconds cannot be stored into a column of any temporal data type. Any microseconds part is discarded.

You can store your date as string.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM