diff --git a/lib/elixir/lib/calendar/datetime.ex b/lib/elixir/lib/calendar/datetime.ex index 605adb6152..6cf43e3776 100644 --- a/lib/elixir/lib/calendar/datetime.ex +++ b/lib/elixir/lib/calendar/datetime.ex @@ -1622,8 +1622,9 @@ defmodule DateTime do Accepts an `amount_to_add` in any `unit`. `unit` can be `:day`, `:hour`, `:minute`, `:second` or any subsecond precision from - `t:System.time_unit/0`. It defaults to `:second`. Negative values - will move backwards in time. + `t:System.time_unit/0` for convenience but ultimately they are + all converted to microseconds. Negative values will move backwards + in time and the default precision is `:second`. This function relies on a contiguous representation of time, ignoring timezone changes. For example, if you add one day when there diff --git a/lib/elixir/lib/calendar/naive_datetime.ex b/lib/elixir/lib/calendar/naive_datetime.ex index babfc23adc..732c806227 100644 --- a/lib/elixir/lib/calendar/naive_datetime.ex +++ b/lib/elixir/lib/calendar/naive_datetime.ex @@ -402,8 +402,9 @@ defmodule NaiveDateTime do Accepts an `amount_to_add` in any `unit`. `unit` can be `:day`, `:hour`, `:minute`, `:second` or any subsecond precision from - `t:System.time_unit/0`. It defaults to `:second`. Negative values - will move backwards in time. + `t:System.time_unit/0` for convenience but ultimately they are + all converted to microseconds. Negative values will move backwards + in time and the default precision is `:second`. ## Examples diff --git a/lib/elixir/lib/calendar/time.ex b/lib/elixir/lib/calendar/time.ex index 731303c7a9..831a19aaed 100644 --- a/lib/elixir/lib/calendar/time.ex +++ b/lib/elixir/lib/calendar/time.ex @@ -514,8 +514,9 @@ defmodule Time do Accepts an `amount_to_add` in any `unit`. `unit` can be `:hour`, `:minute`, `:second` or any subsecond precision from - `t:System.time_unit/0`. It defaults to `:second`. Negative values - will move backwards in time. + `t:System.time_unit/0` for convenience but ultimately they are + all converted to microseconds. Negative values will move backwards + in time and the default precision is `:second`. Note the result value represents the time of day, meaning that it is cyclic, for instance, it will never go over 24 hours for the ISO calendar.