TimeMachinex v0.3.0 TimeMachinex

Define a generic clock api

Link to this section Summary

Functions

Return the current time from the configured adapter

Return the current time from the configured adapter

Link to this section Functions

Link to this function

now(opts \\ [])

now(keyword()) :: DateTime.t()

Return the current time from the configured adapter

Options are: precision: :microsecond | :millisecond | :second, default: microsecond

Examples

iex> TimeMachinex.now
~U[2019-12-16 00:35:07.571Z]
Link to this function

utc_now(opts \\ [])

utc_now(keyword()) :: UTCDateTime.t()

Return the current time from the configured adapter

Options are: precision: :microsecond | :millisecond | :second, default: microsecond

Examples

iex> TimeMachinex.utc_now
~Z[2019-12-16 00:35:11.422092]