Kernel.sigil_N
You're seeing just the macro
sigil_N
, go back to Kernel module for more information.
Handles the sigil ~N
for naive date times.
By default, this sigil uses the built-in Calendar.ISO
, which
requires naive date times to be written in the ISO8601 format:
~N[yyyy-mm-dd hh:mm:ss]
~N[yyyy-mm-dd hh:mm:ss.ssssss]
~N[yyyy-mm-ddThh:mm:ss.ssssss]
such as:
~N[2015-01-13 13:00:07]
~N[2015-01-13T13:00:07.123]
If you are using alternative calendars, any representation can be used as long as you follow the representation by a single space and the calendar name:
~N[SOME-REPRESENTATION My.Alternative.Calendar]
The lower case ~n
variant does not exist as interpolation
and escape characters are not useful for date time sigils.
More information on naive date times can be found in the
NaiveDateTime
module.
Examples
iex> ~N[2015-01-13 13:00:07]
~N[2015-01-13 13:00:07]
iex> ~N[2015-01-13T13:00:07.001]
~N[2015-01-13 13:00:07.001]