Date and time computing
- Template:MJD2Weekdate gives 2024-W52-6
- {{MJD2Weekdate|{{MJD}}+220}} gives 2025-W32-1 (220 days from now)
- Template:MJD2orddate gives 2024-363
- {{MJD2orddate|{{MJD}}+220}} gives 2025-217 (220 days from now)
- variable {{CURRENTTIMESTAMP}} gives 20241228001259
- {{evalint|{{CURRENTTIMESTAMP}}}} gives 20241228001259
- {{evalint|{{CURRENTTIMESTAMP}}-10000000000}} gives 20231228001259 (one year ago)
- {{#expr:{{CURRENTTIMESTAMP}}/100}} gives 202412280012.59 (without seconds)
- {{#expr:{{CURRENTTIMESTAMP}}/100-100000000}} gives 202312280012.59 (one year ago)
- {{evalint|{{CURRENTTIMESTAMP}}}} gives 20241228001259
- Template:MJD gives 60672.009016204, Modified Julian Day
- {{MJD|2006|12|31|23|59}} gives 54100.999305556
- Template:YMD2MJD gives 60672, integer value of MJD
- Template:CURRENTJULIANDAY gives 2460672.5, Julian day value for last midnight
- Template:Weekdate gives 2024-W52-6
- {{weekdate|2006|1|1}} gives 2005-W52-7
- It uses Template:Isoyear, Template:Week, and Template:DOW.
- variable {{CURRENTWEEK}} gives 52.
- variable {{CURRENTYEAR}} gives 2024
- Template:MJD2Y gives 2024
- {{MJD2Y|54200}} gives 2007
- {{MJD2Y|{{MJD}}-1000}} gives 2022, 1000 days ago
- with Template:Orddate, {{orddate|2006|2|12}} gives 43 (ordinal date)
- variable {{CURRENTDOW}} (1=Monday, .. , 6=Saturday, 0=Sunday) gives 6
- with Template:DOW, {{DOW|2006|12|31}} gives 7
- Template:Dectime gives 0.0090162037037037
- Template:CURRENTINTERNETTIME, current value: 050, three digits (between 000 and 999).
- compare dectime + 1 hour: 0.05068287037037
- Template:CURRENTINTERNETTIME, current value: 050, three digits (between 000 and 999).
- variable {{CURRENTTIME}} gives 00:12 (hh:mm)
- Template:Hour gives 00, two digits (00 - 23)
- {{hour|12:43}} gives 12
- {{hour|{{MJD}}}} gives 00.0090162039996358
- {{hour|{{MJD}}+1.25}} gives 01.2590162039996
- Template:Minute gives 12, two digits (00 - 59)
- {{minute|12:43}} gives 43
- {{minute|{{MJD}}}} gives 12
- {{minute|{{MJD}}+1.01}} gives 27
- {{#expr:{{CURRENTTIMESTAMP}} mod 100}} gives 59, second
- {{CURRENTCENTURY}}, current value: 21, no extra leading zero.
- {{CURRENTISOYEAR}}, current value: 2024, no extra leading zero.
See also:
- ParserFunctions
- Date and time computing 1
- Help:Variable#Varying with time
- Help:Magic words#Time
- Category:Date computing template
- w:en:Category:Date math
- w:en:Category:Date computing template based on current time
- w:en:Category:Date computing template
- w:fr:Catégorie:Modèle calculant une date basée sur l'heure actuelle