Marcus

Marcus

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!

Showing Posts 1 to 6

Marcus

Marcus OP

TimeZoneInfo 0.4.0 is released.

In this release, the format for the Downloader is changed to mode. Possible modes are :iana, :etf, and :ws. The mode :ws is new and is used for fetching data from a web service. For now, such a web service exist just as an example at time_zone_info/examples/time_zone_info_server.
The advantage of the new mode is, that the transformation of the IANA data happens on the server.

I have also added a clock example that is using the example server.

This asciinema screencast shows the examples in action.

LostKobrakai

LostKobrakai

I’m wondering if a :os mode would be possible on unix machines using Tzinfo - Parsing the time zone information format (zonefiles)

Marcus

Marcus OP

Maybe, I’ll check it out.

Marcus

Marcus OP

Hello, @LostKobrakai . I have taken a look in the TZif data, and if I understand it right (and please correct if I misunderstood it) is here the offset for a period utc-offset + std-offset. But the callbacks in TimeZoneDatabase want std-offset and std-offset separated (time_zone_period).

LostKobrakai

LostKobrakai

Yeah, it seems it’s not divided up in those files.

Marcus

Marcus OP

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.

— All posts loaded —

Where Next? Top

Trending in Announcing Top

woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
MRdotB
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
fuelen
Hi all! I want to present a small library which provides a mix task for generating an Entity-Relationship Diagram for Ecto schemas. You...
New
anuaralfetahe
Hello Published a new library - ProcessHub! ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
AstonJ
This showed up on my feed.. anyone heard of it? Just hype? Ox Alpha is a reasoning model designed for coding, sustained ag...
New
sergio
It’s not that it’s vocabulary is too advanced. It’s something worse. I get lost trying to follow even a paragraph written by Claude. It’...
New
sorenone
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
New
akoutmos
@hugobarauna, Dr. Dimitrios Koutmos (my brother) and I (Alex Koutmos) have been hard at work on writing a book on how you can use Elixir ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews