Time.new-exclamation-mark
You're seeing just the function
new-exclamation-mark
, go back to Time module for more information.
Link to this function
new!(hour, minute, second, microsecond \\ {0, 0}, calendar \\ Calendar.ISO)
View Source (since 1.11.0)Specs
new!( Calendar.hour(), Calendar.minute(), Calendar.second(), Calendar.microsecond() | non_neg_integer(), Calendar.calendar() ) :: t()
Builds a new time.
Expects all values to be integers. Returns time
if each
entry fits its appropriate range, raises if the time is invalid.
Microseconds can also be given with a precision, which must be an integer between 0 and 6.
The built-in calendar does not support leap seconds.
Examples
iex> Time.new!(0, 0, 0, 0)
~T[00:00:00.000000]
iex> Time.new!(23, 59, 59, 999_999)
~T[23:59:59.999999]
iex> Time.new!(24, 59, 59, 999_999)
** (ArgumentError) cannot build time, reason: :invalid_time