This site is supported by donations to The OEIS Foundation.

Template:Date/doc

From OeisWiki
Jump to: navigation, search


alt = This template is under construction...
This template is under construction.            

Please do not use this unfinished and/or still unreliable template.            


This documentation subpage contains instructions, categories, or other information for Template:Date. [<Edit> Template:Date]

[⧼Purge⧽ Template:Date/doc]

The {{Date}} date mathematics template returns the date which is offset by a specified number of days from a given date. The initial date and the final date must both be within the years [1..10000] CE (Christ Era.)

Usage

{{Date|year=year as a nonzero unformatted integer in [1..10000]|month=month as two digit number in [1..12], abbreviation or full name|monthday=day of month|daydiff=day difference as an integer}}

or

{{Date|year as a nonzero unformatted integer in [1..10000]|month as two digit number in [1..12], abbreviation or full name|day of month|day difference as an integer}}

or

{{Date|daydiff=day difference as an integer}} where year, month and monthday default to local year, local month and local day of month for OEIS Wiki server

or

{{Date}} where year, month and monthday default to local year, local month and local day of month for OEIS Wiki server and offset defaults to zero (thus giving today's date according to the time zone of the OEIS Wiki server)

Examples

Examples with valid arguments

Code Result

Examples with invalid valid arguments (gives an error message)

Code Result

Code


{{From day of CE| {{To day of CE}} + {{{4|0}}} }}

Sandbox

Cf. Help:Extension:ParserFunctionsMediaWiki.org.

{{#time: d F Y | 25 February 1999 + 3 days + 2 months + 1 years}}

gives

28 April 2000

{{#time: d F Y | 25 February 1999 - 3 days + 2 months - 1 year}}

gives

22 April 1998

See also

  • {{daynum}} gives the weekday number (0 to 6) for (Sun to Sat)
  • {{day}} gives the standard three letter weekday abbreviation.
  • {{fullday}} gives the full weekday name.


  • {{monthnum}} gives the month number (padded left with 0 if necessary to get two decimal digits) (01 to 12)
  • {{month}} gives the standard three letter month abbreviation.
  • {{fullmonth}} gives the full month name.
  • {{days in month}} (or {{monthdays}}) gives the number of days in a month (for any year from 1 AD to 10000 AD)


  • {{yearday}} returns the day of year from year, month and monthday (for any year from 1 AD to 10000 AD)
  • {{ifleapyear}} or {{if leap year}} returns different values depending on whether a given year is a leap year or a common year (for any year from 1 AD to 10000 AD)
  • {{is leap year}} predicate function template returns 1 (if true) or 0 (if false) depending on whether a given year is a leap year or a common year (for any year from 1 AD to 10000 AD)
  • {{Century}} returns the century for any nonzero (negative or positive) year
  • {{Millennium}} returns the millennium for any nonzero (negative or positive) year


  • {{to day of CE}} returns the day of CE (Christ Era) from year, month and monthday (for any year from 1 AD to 10000 AD)
  • {{from day of CE}} returns year, month and monthday (for any year from 1 AD to 10000 AD) from the day of CE (Christ Era)


  • {{date}} for date mathematics (for any year from 1 AD to 10000 AD) (returns the date offset a specified number of days from a given date)
  • {{days between}} for date mathematics (for any years from 1 AD to 10000 AD) (returns the number of days between two dates)