Date and time computing

From Meta, a Wikimedia project coordination wiki
(Redirected from Date)
Jump to navigation Jump to search
  • Template:MJD2Weekdate gives 2018-W29-5
    • {{MJD2Weekdate|{{MJD}}+220}} gives 2019-W08-7 (220 days from now)
  • Template:MJD2orddate gives 2018-201
    • {{MJD2orddate|{{MJD}}+220}} gives 2019-056 (220 days from now)
  • variable {{CURRENTTIMESTAMP}} gives 20180720045516
    • {{evalint|{{CURRENTTIMESTAMP}}}} gives 20180720045516
      • {{evalint|{{CURRENTTIMESTAMP}}-10000000000}} gives 20170720045516 (one year ago)
    • {{#expr:{{CURRENTTIMESTAMP}}/100}} gives 201807200455.16 (without seconds)
    • {{#expr:{{CURRENTTIMESTAMP}}/100-100000000}} gives 201707200455.16 (one year ago)
  • variable {{CURRENTYEAR}} gives 2018
    • Template:MJD2Y gives 2018
    • {{MJD2Y|54200}} gives 2007
    • {{MJD2Y|{{MJD}}-1000}} gives 2015, 1000 days ago
  • variable {{CURRENTDOW}} (1=Monday, .. , 6=Saturday, 0=Sunday) gives 5
  • with Template:DOW, {{DOW|2006|12|31}} gives 7
  • Template:Hour gives 04, two digits (00 - 23)
  • {{hour|12:43}} gives 12
  • {{hour|{{MJD}}}} gives 04
  • {{hour|{{MJD}}+1.25}} gives 10
  • Template:Minute gives 55, two digits (00 - 59)
  • {{minute|12:43}} gives 43
  • {{minute|{{MJD}}}} gives 55
  • {{minute|{{MJD}}+1.01}} gives 09
  • {{#expr:{{CURRENTTIMESTAMP}} mod 100}} gives 16, second
  • {{CURRENTCENTURY}}, current value: 21, no extra leading zero.
  • {{CURRENTISOYEAR}}, current value: 2018, no extra leading zero.

See also: