Feature request: Get Timezone from TZ name
sporto opened this issue · comments
Sebastian Porto commented
I'm not sure if this is possible currently, seems not.
Most of the time all I have a is a Timezone name coming from the database e.g. Australia/Melbourne
The function unpack
wants a lot more information that I don't have.
Given that you already have functions for creating the timezone e.g. australia_melbourne ()
. I suppose that you can do the reverse and get a timezone by using the name.
It would be great to have a way to get aTimeZone
just by using the name. e.g.
fromName "Australia/Melbourne"
. Is this possible already?
e.g.
fromName name
case name of
'Australia/Melbourne' ->
Just (australia_melbourne ())
...
_ ->
Nothing
Bogdan Popa commented
I've added TimeZones.fromName
to the latest version.
Sebastian Porto commented
Thanks!