Jump to content

Date and time computing

From Meta, a Wikimedia project coordination wiki
  • Template:MJD2Weekdate gives 2024-W52-3
    • {{MJD2Weekdate|{{MJD}}+220}} gives 2025-W31-5 (220 days from now)
  • Template:MJD2orddate gives 2024-360
    • {{MJD2orddate|{{MJD}}+220}} gives 2025-214 (220 days from now)
  • variable {{CURRENTTIMESTAMP}} gives 20241225054116
    • {{evalint|{{CURRENTTIMESTAMP}}}} gives 20241225054116
      • {{evalint|{{CURRENTTIMESTAMP}}-10000000000}} gives 20231225054116 (one year ago)
    • {{#expr:{{CURRENTTIMESTAMP}}/100}} gives 202412250541.16 (without seconds)
    • {{#expr:{{CURRENTTIMESTAMP}}/100-100000000}} gives 202312250541.16 (one year ago)
  • variable {{CURRENTYEAR}} gives 2024
    • Template:MJD2Y gives 2024
    • {{MJD2Y|54200}} gives 2007
    • {{MJD2Y|{{MJD}}-1000}} gives 2022, 1000 days ago
  • variable {{CURRENTDOW}} (1=Monday, .. , 6=Saturday, 0=Sunday) gives 3
  • with Template:DOW, {{DOW|2006|12|31}} gives 7
  • Template:Hour gives 05, two digits (00 - 23)
  • {{hour|12:43}} gives 12
  • {{hour|{{MJD}}}} gives 21.236990741003
  • {{hour|{{MJD}}+1.25}} gives 22.486990741003
  • Template:Minute gives 41, two digits (00 - 59)
  • {{minute|12:43}} gives 43
  • {{minute|{{MJD}}}} gives 41
  • {{minute|{{MJD}}+1.01}} gives 55
  • {{#expr:{{CURRENTTIMESTAMP}} mod 100}} gives 16, second
  • {{CURRENTCENTURY}}, current value: 21, no extra leading zero.
  • {{CURRENTISOYEAR}}, current value: 2024, no extra leading zero.

See also: