Elixir version: 1.8.1
I want to convert naive datetime to datetime with DateTime.from_naive/3
and need an implementation of Calendar.TimeZoneDatabase
.
I found only Tzdata.TimeZoneDatabase
, but I can’t use this becuase it’s rc version.
Is there any available TimeZoneDatabase now?
1 Like
You can use the stable version of tzdata. It’s currently 0.5.20: https://hex.pm/packages/tzdata
6 Likes
For note, Timex uses tzdata and gives it a very nice interface with lots of useful interaction functions and more.
2 Likes
How can I convert native datetime to datetime with timex
?
I can’t find implementation of TimeZoneDatabase
behaviour in tzdata
0.5.20.
1 Like
The behaviour is only available from version 1.0.0, if you can’t use an rc version until the final is out, the best alternative is to use Timex.
To convert using Timex 3.5.0
:
now = NaiveDateTime.utc_now()
datetime = Timex.to_datetime(now, "America/Sao_Paulo")
6 Likes
Lau
April 25, 2019, 7:46pm
9
tzdata 1.0.0 is now released
7 Likes