Calendar.Date.Format

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

Functions

iso8601(date)

Format a date as ISO 8601 extended format

Examples

iex> {2015, 4, 3} |> iso8601
"2015-04-03"
iso8601_basic(date)

Format a date as ISO 8601 basic format

Examples

iex> {2015, 4, 3} |> iso8601_basic
"20150403"
iso_week_date(date)

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"
ordinal(date)

Format a date as ISO 8601 ordinal format

Examples

iex> {2015, 4, 3} |> ordinal
"2015-093"
week_number(date)

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"