Template:Century/doc

From IxWiki
Jump to navigation Jump to search

This template computes the calendar century number for the Gregorian year in parameter. It is different from the astronomical century number (which starts at 0).

Syntax

{{Century|year}}
  • The year must be astronomical (year=1 in 1 AD (Anno Domini), year=0 in 1 BC, year=-1 in 2 BC).

Examples

{{Century|2102}} returns 22
{{Century|2101}} returns 22
{{Century|2100}} returns 21
{{Century|2099}} returns 21
{{Century|2098}} returns 21
{{Century|2002}} returns 21
{{Century|2001}} returns 21
{{Century|2000}} returns 20
{{Century|1999}} returns 20
{{Century|1998}} returns 20
{{Century|1902}} returns 20
{{Century|1901}} returns 20
{{Century|1900}} returns 19
{{Century|1899}} returns 19
{{Century|1898}} returns 19
{{Century|102}} returns 2
{{Century|101}} returns 2
{{Century|100}} returns 1
{{Century|99}} returns 1
{{Century|98}} returns 1
{{Century|2}} returns 1
{{Century|1}} returns 1
{{Century|0}} returns -1
{{Century|-1}} returns -1
{{Century|-2}} returns -1
{{Century|-98}} returns -1
{{Century|-99}} returns -1
{{Century|-100}} returns -2
{{Century|-101}} returns -2
{{Century|-1098}} returns -11
{{Century|-1099}} returns -11
{{Century|-1100}} returns -12
{{Century|-1101}} returns -12

See also

Template:MILLENNIUM
Template:DECADE
Template:YEARCC
Template:YEARYY
Template:MONTHDAYS
Template:IsLeapYear
Template:JULIANDAY
Template:Weekday
Template:CURRENTCENTURY