DateTime.to_date
You're seeing just the function
to_date
, go back to DateTime module for more information.
Specs
to_date(Calendar.datetime()) :: Date.t()
Converts a DateTime
into a Date
.
Because Date
does not hold time 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, 0},
...> utc_offset: 3600, std_offset: 0, time_zone: "Europe/Warsaw"}
iex> DateTime.to_date(dt)
~D[2000-02-29]