As the title reads, how can I convert a UNIX timestamp, e.g. 1458297862, into a Date object in Elm?
Date.fromString
does not seem to accept it, and Date.fromTime
gives the wrong answer.
You can use Date.fromTime
, but you have to multiply that value by 1000
.
This gives you the date you'd expect:
Date.fromTime 1458297862000
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments