I want to get a Date in elm that represents the user's local date and time. I have looked at the core Date module as well as the elm-time package.
The elm-time package has a ZonedDateTime
, but a TimeZone
value must be supplied to it, and therefore, the time zone must be known ahead of time.
At its core, this issue is about reliably determining the user's timezone. The best solution I've come up with, which is too naive to be considered acceptable, is to pass the user's timezone offset via javascript as an application flag and modify a UTC date accordingly.
With the current 0.19.1 version:
Time.here : Task x Zone
to get the current time zone.Time.now : Task x Posix
to get the current date.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