Template:IsLeapYear
0
- Usage:
{{IsLeapYear|year}}- year defaults to {{
CURRENTYEAR}} = 2026. 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). - This template is substitutable.
- Formula:
- Is equivalent to {{#expr: ((({{{1}}}) mod 4 = 0) and (({{{1}}}) mod 100 != 0)) or (({{{1}}}) mod 400 = 0)}}, but for efficiency is currently coded as {{#time:L | 1 January {{{1}}} }}
- Sanity check:
- {{ IsLeapYear | 2000 }} gives 1: 2000 AD is effectively a leap year (in both the Julian and Gregorian calendars).
- {{ IsLeapYear | 502*4-8 }} gives 1: 2000 AD is effectively a leap year (in both the Julian and Gregorian calendars).
- {{ IsLeapYear | 2001 }} gives 0: 2001 AD is not a leap year.
- {{ IsLeapYear | 2004 }} gives 1: 2004 AD is a leap year.
- {{ IsLeapYear | 2005 }} gives 0: 2005 AD is not a leap year.
- {{ IsLeapYear | 2007 }} gives 0: 2007 AD is not a leap year.
- {{ IsLeapYear | 2008 }} gives 1: 2008 AD is a leap year.
- {{ IsLeapYear | 2009 }} gives 0: 2009 AD is not a leap year.
- {{ IsLeapYear | 2100 }} gives 0: 2100 AD is not a leap year in the Gregorian calendar (but not in the Julian calendar).
- {{ IsLeapYear | 2400 }} gives 1: 2400 AD is effectively a leap year (in both the Julian and Gregorian calendars).
- {{ IsLeapYear | 1900 }} gives 0: 1900 AD is not a leap year in the Gregorian calendar (but not in the Julian calendar).
- {{ IsLeapYear | 1800 }} gives 0: 1800 AD is not a leap year in the Gregorian calendar (but not in the Julian calendar).
- {{ IsLeapYear | 1700 }} gives 0: 1700 AD is not a leap year in the Gregorian calendar (but not in the Julian calendar).
- {{ IsLeapYear | 1600 }} gives 1: 1600 AD is effectively a leap year (in both the Julian and Gregorian calendars).
- {{ IsLeapYear | 1500 }} gives 0: 1500 AD is not a leap year in the proleptic Gregorian calendar (but is leap in the actual Julian calendar).
- {{ IsLeapYear | 0 }} gives 1: 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 0: 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 }} = 1 are unspecified, even if it apparently gives an "expected" result at the moment this might change without notice.
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.