Calendar v1.0.0 Calendar.Date.Format View Source

Link to this section Summary

Functions

Format a date as ISO 8601 extended format

Format a date as ISO 8601 basic format

Format a date as ISO 8601 year and week number with weekday.

Format a date as ISO 8601 ordinal format

Make a ISO 8601 week date string for the ISO week that the provided date is in.

Link to this section Functions

Format a date as ISO 8601 extended format

Examples

iex> {2015, 4, 3} |> iso8601
"2015-04-03"

Format a date as ISO 8601 basic format

Examples

iex> {2015, 4, 3} |> iso8601_basic
"20150403"

Format a date as ISO 8601 year and week number with weekday.

Please not that as with all ISO weekdays the year of the week is not always the same as the year of the date.

Examples

iex> {2015, 4, 3} |> iso_week_date
"2015-W14-5"

Format a date as ISO 8601 ordinal format

Examples

iex> {2015, 4, 3} |> ordinal
"2015-093"

Make a ISO 8601 week date string for the ISO week that the provided date is in.

The string does not have information about the specific date.

See also iso_week_date/1

Examples

iex> {2015, 4, 3} |> week_number
"2015-W14"