Marcus

Marcus

TimeZoneInfo - just another TimeZoneDatabase

Hello,

TimeZoneInfo is just another TimeZoneDatabase.

Motivation: Before Tz was released my motivation was to fix some things in Tzdata. So TimeZoneInfo includes all fixes that are also in Tz and mentioned in this post. After Tz was released I keep on coding because I have some different approaches and I wanted to play with :persistent_term, :ets, NimbleParsec, and ETF (Erlang Term Format).

The most differences to the other both libraries are mentioned in the last section, but here are some details.

Some benchmarks to compare TimeZoneInfo, Tz, and Tzdata.

TimeZoneInfo uses NimbleParsec to parse the IANA data. The parsed data is related to the pure IANA data, which means it should be easy to write this data back to a valid IANA file. After that, this data will be transformed into a TimeZoneInfo.data format.

The data will be persisted in the priv dir in a zipped ETF format. If you want to save the data in another way you can configure this as you need.

At runtime, the data can be stored in two different ways. Either with :persistent_term (OTP >
21.2) or with :ets. That can be also configured as data_store: :detect (default), in this case TimeZoneInfo will select :persistent_term if it is available.

An automatic update is supported but is disabled by default. The downloader for the update is configurable and custom downloader can be used. It is also possible to download directly TimeZoneInfo.data in a zipped ETF file.

Furthermore, you can configure which time zones should be used and how many years should be calculated in advance.
For time zones with continuation rules transitions in the future will be calculated on the fly if the periods-table does not contain enough info for those date times.

Thanks for your attention.

Comments, critic, reviews, issues and PRs are welcome!

Most Liked

Marcus

Marcus

Version 0.5.0 is released. The new version comes with some performance improvements and some bugfixes.
I have also added a benchmark to compare the DataStores with :ets and :persistent_term. The benchmark to compare TimeZoneInfo, Tz, and Tzdata is using the DataStore with :persistent_term.

Where Next?

Popular in Announcing Top

grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 54006 488
New
jakub-zawislak
Hi everyone, I’m coming from the Symfony (PHP) framework. I like Phoenix, but it has a one thing that was build much better in the Symfo...
New
Azolo
Hey everyone, I just released WebSockex which is a Elixir WebSocket client. WebSockex strives to work as a OTP special process, be RFC6...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
kip
Image is an image processing library for Elixir. It is based upon the fabulous vix library that provides a libvips wrapper for Elixir. I...
622 19460 194
New
wojtekmach
Hey everyone! Req is an HTTP client for Elixir that I’ve been working on for quite some time. There is already a lot of HTTP clients out...
New
Flo0807
Hello everyone! I am excited to share our heart project Backpex with you. After building several Phoenix applications, we realized that...
New

Other popular topics Top

KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36654 110
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 31494 112
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement