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.
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With