Date.leap_year-question-mark

You're seeing just the function leap_year-question-mark, go back to Date module for more information.
Link to this function

leap_year?(date)

View Source (since 1.4.0)

Specs

leap_year?(Calendar.date()) :: boolean()

Returns true if the year in the given date is a leap year.

Examples

iex> Date.leap_year?(~D[2000-01-01])
true
iex> Date.leap_year?(~D[2001-01-01])
false
iex> Date.leap_year?(~D[2004-01-01])
true
iex> Date.leap_year?(~D[1900-01-01])
false
iex> Date.leap_year?(~N[2004-01-01 01:23:45])
true