timely v1.0.0 Timely

Provides functions for converting, comparing and shifting Elixir date & times.

Link to this section Summary

Link to this section Types

Link to this type

date_or_time_like()
date_or_time_like() ::
  Date.t()
  | DateTime.t()
  | NaiveDateTime.t()
  | Ecto.Date.t()
  | Ecto.DateTime.t()
  | String.t()

Link to this type

date_tuple()
date_tuple() :: {integer(), integer(), integer()}

Link to this type

datetime_tuple()
datetime_tuple() ::
  {{integer(), integer(), integer()}, {integer(), integer(), integer()}}

Link to this type

microseconds()
microseconds() :: {integer(), integer()}

Link to this type

spec_or_format()
spec_or_format() :: Atom.t() | String.t()

A known spec or a format string.

Link to this type

time_zone()
time_zone() :: binary()

A valid time zone.

Link to this section Functions

Link to this function

after?(dt1, dt2)

Link to this function

ago(dt \\ utc(), units, scale)

Link to this function

as(error, format_or_spec)

Converts common date time like date structures to other common date time like data structures.

Link to this function

before?(dt1, dt2)

Link to this function

before_or_on?(dt1, dt2)

Link to this function

equal?(dt1, dt2)

Link to this function

from_now(dt \\ utc(), units, scale)

Link to this function

in_timezone(datetime, timezone)

Link to this function

new_datetime(arg, microseconds \\ {0, 6}, time_zone \\ "Etc/UTC")
new_datetime(datetime_tuple(), microseconds(), time_zone()) :: DateTime.t()

Initializes a DateTime.

Link to this function

now_in_timezone()

Link to this function

now_in_timezone(timezone)

Link to this function

on_or_after?(dt1, dt2)