diff options
author | José Valim <jose.valim@plataformatec.com.br> | 2016-09-15 10:13:26 +0200 |
---|---|---|
committer | José Valim <jose.valim@plataformatec.com.br> | 2016-09-15 10:13:26 +0200 |
commit | 06111e7020d754000c7beb554f4fe0635306906c (patch) | |
tree | e214f0e86def43f5f469a75e23b55e263152c3b7 | |
parent | 8d2c5baa9be62dedec2b2702d5e26de6f803dcf2 (diff) | |
download | elixir-06111e7020d754000c7beb554f4fe0635306906c.tar.gz |
Improve Calendar docs
-rw-r--r-- | lib/elixir/lib/calendar.ex | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/elixir/lib/calendar.ex b/lib/elixir/lib/calendar.ex index 750bf736d..ffc99735a 100644 --- a/lib/elixir/lib/calendar.ex +++ b/lib/elixir/lib/calendar.ex @@ -654,8 +654,11 @@ defmodule NaiveDateTime do be converted to microseconds internally. Even though Unix times are always in UTC, the time zone - is not stored in the naive date time. Prefer using - `DateTime.from_unix/2` when possible as, opposite + is not stored in the naive date time, occuring in loss + of information. For this reason, in order to convert a + NaiveDateTime back to Unix time, you first need to call + `DateTime.from_naive/2` with a timezone. For such reason, + prefer using `DateTime.from_unix/2` when possible as, opposite to `NaiveDateTime`, it will keep the time zone information. ## Examples |