Is there any available TimeZoneDatabase now?

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

What about using timex?

2 Likes

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. :slight_smile:

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

Thx a lot!

1 Like

tzdata 1.0.0 is now released

7 Likes