DateTime.to_time
You're seeing just the function
to_time
, go back to DateTime module for more information.
Specs
to_time(Calendar.datetime()) :: Time.t()
Converts a DateTime
into Time
.
Because Time
does not hold date nor time zone information,
data will be lost during the conversion.
Examples
iex> dt = %DateTime{year: 2000, month: 2, day: 29, zone_abbr: "CET",
...> hour: 23, minute: 0, second: 7, microsecond: {0, 1},
...> utc_offset: 3600, std_offset: 0, time_zone: "Europe/Warsaw"}
iex> DateTime.to_time(dt)
~T[23:00:07.0]