Does the timestamp type have (hidden) milliseconds?
updatedcolumn was created as
| updated | timestamp | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
+---------------------+ | updated | +---------------------+ | 2021-12-25 00:15:47 | +---------------------+
updatedwas not created as
Is there any way to extract more accuracy from
updated? (does MySQL store more precision than the second, even though it shows only seconds?)
Is there any way to extract more accuracy from updated?
No. It is not possible to select the data which is absent in the table and cannot be calculated from the data present in the tables.
does MySQL store more precision than the second, even though it shows only seconds?
No. It stores exactly what you asked for. It can store up to microsecond - but you have not asked for this accuracy.
Well, it really is déjà vu all over again with this question! There appears to be a bug in MySQL's implementation of this... (quelle suprise - a bug in MySQL...) at least on dbfiddle.uk and dbfiddle.com. – Vérace - get VACCINATED NOW
NOW()- and you get the datetime without milliseconds. Call
NOW(6)and get more accurate value.
Well, good news from the MySQL camp - you don't need to worry about fractional values of a second at all - 5.7 doesn't support them – Vérace - get VACCINATED NOW
Never consult the person from the MySQL camp who said this nonsense again.