Elixir version: 1.8.1
I want to convert naive datetime to datetime with
DateTime.from_naive/3 and need an implementation of
I found only
Tzdata.TimeZoneDatabase, but I can’t use this becuase it’s rc version.
Is there any available TimeZoneDatabase now?
You can use the stable version of tzdata. It’s currently 0.5.20: https://hex.pm/packages/tzdata
For note, Timex uses tzdata and gives it a very nice interface with lots of useful interaction functions and more.
How can I convert native datetime to datetime with
I can’t find implementation of
TimeZoneDatabase behaviour in
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
now = NaiveDateTime.utc_now()
datetime = Timex.to_datetime(now, "America/Sao_Paulo")
tzdata 1.0.0 is now released