summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@plataformatec.com.br>2016-09-15 10:13:26 +0200
committerJosé Valim <jose.valim@plataformatec.com.br>2016-09-15 10:13:26 +0200
commit06111e7020d754000c7beb554f4fe0635306906c (patch)
treee214f0e86def43f5f469a75e23b55e263152c3b7
parent8d2c5baa9be62dedec2b2702d5e26de6f803dcf2 (diff)
downloadelixir-06111e7020d754000c7beb554f4fe0635306906c.tar.gz
Improve Calendar docs
-rw-r--r--lib/elixir/lib/calendar.ex7
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