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!

#tz

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 Libraries Top

josevalim
Hi everyone, We would like to announce that Plataformatec is working on a new MySQL driver called MyXQL. Our goal is to eventually integ...
New
Qqwy
TypeCheck: Fast and flexible runtime type-checking for your Elixir projects. Core ideas Type- and function specifications are const...
336 13801 100
New
oltarasenko
Dear Elixir community, After a year of development, bug fixes, and improvements, we are proudly ready to share the release of Crawly 0.1...
New
seancribbs
Today I released a new dialyzer Mix task as the dialyzex package! At the time we started writing this task, the existing dialyzer integra...
New
woylie
I released Doggo, a collection of unstyled Phoenix components. Features Unstyled Phoenix components. Storybook that can be added to...
New
Crowdhailer
I have been updating a library that allows you to pipe between functions that use the erlang result tuple convention. Assuming you have...
New
Qqwy
Hello everyone, I wrote a small library today called MapDiff. It returns a map listing the (smallest amount of) changes to get from map...
New
ahamez
Hi everyone, I’ve been working on this protobuf library for 3 years. We use it in the company I work for, EasyMile, to communicate with ...
New
vic
Expat is a tiny experiment I did for extracting patterns and being able to reuse them (compose and share patterns between elixir librarie...
New
mischov
import Meeseeks.CSS html = HTTPoison.get!("https://news.ycombinator.com/").body for story <- Meeseeks.all(html, css("tr.athing")) do...
New

Other popular topics Top

peerreynders
Manning 2016 Halloween weekend sale via Deal of the Day Friday, October 28 - Half off all MEAPs - code WM102816LT Saturday, October 29 ...
326 29600 154
New
dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New

Sub Categories:

We're in Beta

About us Mission Statement