Wikipedia:Date math
Tools
Actions
General
Print/export
In other projects
Date math on Wikipedia is done withvariables,templates and the#timeparser function.
In articles, it is almost always preferred to specify a specific static date for a statement or event rather than an automatically generated date.Wikipedia:As of describes how to properly specify such dates.
| Built-in variables | Templates based on them | What you see | Comments |
|---|---|---|---|
| {{CURRENTTIMESTAMP}} | 20251216122013 | ||
| {{CURRENTYEAR}} | 2025 | ||
| {{UTC}} | 2025-12-16 12:20 UTC | also uses {{CURRENTMONTH}} {{CURRENTDAY2}} {{CURRENTTIME}} | |
| {{CURRENTDATE}} | 12:20, Tuesday, December 16, 2025 (UTC) | also uses {{CURRENTTIME}} {{CURRENTDAYNAME}} {{CURRENTMONTHNAME}} {{CURRENTDAY}} | |
| {{CURRENTJULIANDAY}} | 2461026.0140394 | currentJulian dayalso uses {{CURRENTMONTH}} {{CURRENTDAY}} {{CURRENTHOUR}}{{CURRENTMINUTE}}{{CURRENTSECOND}} | |
| {{CURRENTMONTH}} | 12 | ||
| {{CURRENTMNTH}} | 12 | trims leading zero | |
| {{CURRENTMONTHNAME}} | December | ||
| {{Month+1}} | January | ||
| {{Month-1}} | November | ||
| {{Month-2}} | October | ||
| {{CURRENTDAY}} | 16 | day of month | |
| {{CURRENTDOW}} | 2 | day of week | |
| {{#time:l|-1 day}} | Monday | ||
| {{#time:l}} | Tuesday | ||
| {{#time:l|+1 day}} | Wednesday | ||
| Any variable or template with a resolution of smaller than one day should not be placed in articles. These variables only indicate when the article was parsed and cached; they may lag by many hours or even days compared to the time the page is viewed. | |||
| {{CURRENTTIME}} | 12:20 | ||
| {{CURRENTHOUR}} | 12 | ||
| {{#time:H|+1 hour}} | 13 | ||
| {{Current hour}} | 12 | trims leading zero | |
| {{#time:i}} | 20 | ||
| {{CURRENTMINUTE}} | 20 | ||
| {{Current minute}} | 20 | trims leading zero | |
| {{#time:s}} | 13 | ||
| {{CURRENTSECOND}} | 13 | ||
| Template name | Usage | Output | Comment |
|---|---|---|---|
| {{Ordinal date}} | {{Ordinal date|year=2007|month=03|day=15}} | 74 | returnsordinal date (day of year) |
| {{Ordinal date|year=2008|month=03|day=15}} | 75 | +1 due to leap year in 2008 | |
| {{WEEKDAY}} | {{WEEKDAY|2009|08|25}} | 1 | returns day of week |
| {{WEEKDAYNAME|{{WEEKDAY|2009|08|25}}}} | Tuesday | ||
| {{JULIANDAY}} | {{JULIANDAY|2009|08|25}} | 2455069 | |
| {{WEEKDAYNAME|{{JULIANDAY|2009|08|25}}}} | Tuesday | Note: 2455069 mod 7 = 1 | |
| {{JULIANDAY|{{CURRENTYEAR}}|{{CURRENTMONTH}}|{{CURRENTDAY}}}} | 2461026 | Nesting templates to get the value of the current Julian day with no decimal portion. Useful for date math between a set point and the current date. | |
| {{JULIANDAY.TIMESTAMP}} | {{JULIANDAY.TIMESTAMP|2455069}} | 20090825120000 | same format as {{CURRENTTIMESTAMP}} |
| {{#time:D Y-m-d|{{JULIANDAY.TIMESTAMP|2455069}}}} | Tue 2009-08-25 |
Julian dates or day numbers can be used for date calculations. A simple example follows:
| {{today cell}} | {{tomorrow cell}} |