Reputation: 40510
Let's say I have an epoch millis value such as 1538637258426
, how do I convert that into a something like a DateTime
representation in Elm 0.19?
I'm not even sure which model I should use to represent a "date time" in Elm 0.19. I cannot find the Date module in core that is referred to from a lot of places on the web (such as this stackoverflow question). Also I cannot seem to install the elm-community/elm-time
package since it's not upgraded to support 0.19.
Upvotes: 6
Views: 877
Reputation: 29106
The official date/time library in 0.19 is elm/time
, which has replaced the old Date
module in core. The type you'll want to use is Time.Posix
, which you can obtain from a milliseconds value using Time.millisToPosix
.
Upvotes: 7