Comments - FROM_UNIXTIME
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.
It is important to note that if you have a table with a TIMESTAMP column:
and you insert a value like so:
The value will undergo a roundtrip conversion, from a number to a date, and then back again, before insertion. Due to daylight savings time and/or leap-seconds, the inserted value may not be what you started with!
For example, in the Australian Eastern Daylight Time timezone, the result of the above query is 1522513800 rather than 1522510200, as the latter value falls within the hour that gets repeated at the end of daylight savings.
I'm not aware of any way to insert a "raw" UNIX time-value, without conversion to a date and back again. There certainly OUGHT to be a method provided to do this however!
UPDATE:
There is a method. You can force insertion of a "raw" UNIX time-value like this:
It's rather clumsy, though!