From 06111e7020d754000c7beb554f4fe0635306906c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Thu, 15 Sep 2016 10:13:26 +0200 Subject: Improve Calendar docs --- lib/elixir/lib/calendar.ex | 7 +++++-- 1 file 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 -- cgit v1.2.1