Surgex.DateTime (Surgex v4.8.1-git-80a7) View Source

Utilities for creating date times.

Link to this section Summary

Functions

Create UTC or time-zone date time given a date and seconds (from midnight) offset.

Link to this section Functions

Link to this function

date_and_offset_to_datetime(date, seconds_since_midnight, timezone \\ "Etc/UTC", ambiguous_hour_pref \\ :after)

View Source

Specs

date_and_offset_to_datetime(Date.t(), integer(), String.t(), atom()) ::
  {:ok, DateTime.t()} | {:error, term()}

Create UTC or time-zone date time given a date and seconds (from midnight) offset.

Examples

iex> Surgex.DateTime.date_and_offset_to_datetime(~D{2021-10-07}, 5400)