সমললৈ যাওক

# সাঁচ:IsLeapYear

### Usage

চমুপথ:
template:ly
`{{IsLeapYear|year}}`
year defaults to {{ `CURRENTYEAR` }} = 2024. It must be specified in the Gregorian calendar, extended to all epochs using linear year numbering: use the proleptic Gregorian calendar in Christian Era before the change, and the astronomical year convention (using negative numbers, and year 0) in all years BC before the Christian era (there's a difference of 1 in absolute value).

### Parameters

• Unnamed parameter The year to calculate with (default: 2024)
• `|yes=` What to output if it is a leap year (default : 1)
• `|no=` What to output if it isn't a leap year (default: 0)

### Formula

The template currently uses Wikimedia function time (#time). It is the same as if 4 mod year = 0 and 100 mod year ≠ 0, then not a leap year, unless 400 mod year = 0, then it is a leap year.

### Sanity check

{{ IsLeapYear | 2000 }} gives ১: 2000 AD is effectively a leap year (in both the Julian and Gregorian calendars).
{{ IsLeapYear | 502*4-8 }} gives ১: 2000 AD is effectively a leap year (in both the Julian and Gregorian calendars).
{{ IsLeapYear | 2001 }} gives ০: 2001 AD is not a leap year.
{{ IsLeapYear | 2004 }} gives ১: 2004 AD is a leap year.
{{ IsLeapYear | 2005 }} gives ০: 2005 AD is not a leap year.
{{ IsLeapYear | 2007 }} gives ০: 2007 AD is not a leap year.
{{ IsLeapYear | 2008 }} gives ১: 2008 AD is a leap year.
{{ IsLeapYear | 2009 }} gives ০: 2009 AD is not a leap year.
{{ IsLeapYear | 2100 }} gives ০: 2100 AD is not a leap year in the Gregorian calendar (but not in the Julian calendar).
{{ IsLeapYear | 2400 }} gives ১: 2400 AD is effectively a leap year (in both the Julian and Gregorian calendars).
{{ IsLeapYear | 1900 }} gives ০: 1900 AD is not a leap year in the Gregorian calendar (but not in the Julian calendar).
{{ IsLeapYear | 1800 }} gives ০: 1800 AD is not a leap year in the Gregorian calendar (but not in the Julian calendar).
{{ IsLeapYear | 1700 }} gives ০: 1700 AD is not a leap year in the Gregorian calendar (but not in the Julian calendar).
{{ IsLeapYear | 1600 }} gives ১: 1600 AD is effectively a leap year (in both the Julian and Gregorian calendars).
{{ IsLeapYear | 1500 }} gives ০: 1500 AD is not a leap year in the proleptic Gregorian calendar (but is leap in the actual Julian calendar).
{{ IsLeapYear | 0 }} gives ১: 1 BC is a leap year in the astronomical calendar (mostly pointless for actual calendars of such epoch, but correct in the astronomical calendar where it is year 0).
{{ IsLeapYear | -100 }} gives ০: 101 BC is not a leap year in the astronomical calendar (mostly pointless for actual calendars of such epoch, but correct in the astronomical calendar where it is year -100).

Results for fractions like {{ IsLeapYear | 2000.9 }} = ১ are rounded down (floor).