ElixirConf 2019 - Date, Time, and Time Zones in Elixir 1.9 - Lau Taarnskov

  Рет қаралды 1,789

ElixirConf

ElixirConf

Күн бұрын

Elixir 1.8 and 1.9 bring changes to the date & time features in Elixir. This talk will go through how to get the most out of Elixir, as it stands now, for date and time functionalities.
Date and time are a part of every Elixir project. Whether it be timestamps in logs, databases, or business logic, date and time issues have the potential to cause significant problems if you are not prepared.
The `TimeZoneDatabase` behavior in Elixir 1.8+ allows using time zone functionality directly in the standard library. We'll walk through examples of how to use it and take advantage of the potential for fewer dependencies.
We will look at the different built-in types for date and time in Elixir. And when to use which one. Choosing the correct type is about semantics, meaning, representing information and data you have available, and avoiding creating fake data. This makes it easier for other developers, other libraries, and other systems to make the most of your date and time data.
We will also look at the new UTC DateTime sigil introduced in Elixir 1.9.
Learn about persisting the date and time types in databases with Ecto 3.
Civil time used today ultimately is tied to how the earth and sun move in relation to each other. This affects leap seconds, which are part of UTC. Besides that, there are many time zones which are determined politically and can change often and with short notice. In certain cases, this can be ignored. The types `NaiveDateTime`, `Date` and `Time` follow rules that do not change often because they are not concerned with these issues. But DateTime depend on an ever-changing database concerning time zones.
How do we keep the time zone database up to date whether deploying to a web server using Phoenix, using containers or to a Nerves device? There are different ways of doing that with different tradeoffs.
Besides looking at how to configure the Tzdata library to use with the TimeZoneDatabase behavior, also get a behind the scenes look at how this library evolved over the last five years. See how both macros and ETS have been used, and which tradeoffs have been made for performance improvements.

Пікірлер
The Problem with Time & Timezones - Computerphile
10:13
Computerphile
Рет қаралды 4,1 МЛН
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН
Google I/O 2012 - Go Concurrency Patterns
51:27
Google for Developers
Рет қаралды 827 М.
Why the world needs PhoenixTest
35:18
ElixirConf
Рет қаралды 1,2 М.
AI Is Making You An Illiterate Programmer
27:22
ThePrimeTime
Рет қаралды 295 М.
Reinforcement Learning: Machine Learning Meets Control Theory
26:03
Steve Brunton
Рет қаралды 298 М.
LiveView Native is ready!
25:57
ElixirConf
Рет қаралды 4,1 М.
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН