I want to get a Date in elm that represents the local date and time of the user. I looked at the core of the date of the module , as well as the elm-time .
The elm-time package has ZonedDateTime, but it needs to specify a value TimeZone, and therefore the time zone must be known in advance.
At the heart of this problem is the reliable determination of the user's time zone . The best solution that I came up with, too naively considered acceptable, is to pass the user’s timezone offset through javascript as the application flag and change the UTC date accordingly.
source
share