Why doesn't MySQL support millisecond precision?
Posted
by Byron Whitlock
on Stack Overflow
See other posts from Stack Overflow
or by Byron Whitlock
Published on 2010-04-03T18:22:44Z
Indexed on
2010/04/03
18:33 UTC
Read the original article
Hit count: 282
So I just found the most frustrating bug ever in MySQL.
Apparently the TIMESTAMP
field, and supporting functions do not support any greater precision than seconds!?
So I am using PHP and Doctrine, and I really need those microseconds (I am using the actAs: [Timestampable]
property).
I found a that I can use a BIGINT
field to store the values. But will doctrine add the milliseconds? I think it just assigns NOW() to the field. I am also worried the date manipulation functions (in SQL) sprinkled through the code will break.
I also saw something about compiling a UDF extension. This is not an acceptable workaround because I or a future maintainer will upgrade and poof, change gone.
Has anyone found a suitable workaround?
© Stack Overflow or respective owner