Convert a double (or string) into a Unix epoch timestamp in MySQL? -
i've seen instructions converting , forth between unix epoch , datetime in mysql -- it's not hard (from_unixtime convert epoch datetime, unix_timestamp current epoch time).
unfortunately, have saved of timestamps server doubles -- , upon attempting cast doubles timestamps, fail.
select from_unixtime(cast('1416355920908' datetime)), from_unixtime(cast(1416355920908 datetime)), from_unixtime(unix_timestamp());
this returns null, null, '2014-11-19 10:18:34' on mysql.
is there way convert number or string epoch or datetime?
it turns out made epochs big exploded mysql... it's mistake initiated in nodejs, when used functions gather epochs instead of relying on mysql. simple fix is:
select from_unixtime(1416355920908 / 1000);
Comments
Post a Comment