NaiveDateTime.from_erl-exclamation-mark
You're seeing just the function
from_erl-exclamation-mark
, go back to NaiveDateTime module for more information.
Specs
from_erl!(:calendar.datetime(), Calendar.microsecond(), Calendar.calendar()) :: t()
Converts an Erlang datetime tuple to a NaiveDateTime
struct.
Raises if the datetime is invalid. Attempting to convert an invalid ISO calendar date will produce an error tuple.
Examples
iex> NaiveDateTime.from_erl!({{2000, 1, 1}, {13, 30, 15}})
~N[2000-01-01 13:30:15]
iex> NaiveDateTime.from_erl!({{2000, 1, 1}, {13, 30, 15}}, {5000, 3})
~N[2000-01-01 13:30:15.005]
iex> NaiveDateTime.from_erl!({{2000, 13, 1}, {13, 30, 15}})
** (ArgumentError) cannot convert {{2000, 13, 1}, {13, 30, 15}} to naive datetime, reason: :invalid_date