Surgex.DateTime (Surgex v6.0.1)

View Source

Utilities for creating date times.

Summary

Functions

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

Functions

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

@spec date_and_offset_to_datetime(Date.t(), integer(), String.t()) ::
  {: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)