Date and time computing

From Meta, a Wikimedia project coordination wiki
(Redirected from Date)
Jump to: navigation, search
  • Template:MJD2Weekdate gives 2014-W30-4
    • {{MJD2Weekdate|{{MJD}}+220}} gives 2015-W09-6 (220 days from now)
  • Template:MJD2orddate gives 2014-205
    • {{MJD2orddate|{{MJD}}+220}} gives 2015-060 (220 days from now)
  • variable {{CURRENTTIMESTAMP}} gives 20140724142033
    • {{evalint|{{CURRENTTIMESTAMP}}}} gives 20140724142033
      • {{evalint|{{CURRENTTIMESTAMP}}-10000000000}} gives 20130724142033 (one year ago)
    • {{#expr:{{CURRENTTIMESTAMP}}/100}} gives 201407241420.33 (without seconds)
    • {{#expr:{{CURRENTTIMESTAMP}}/100-100000000}} gives 201307241420.33 (one year ago)
  • variable {{CURRENTYEAR}} gives 2014
    • Template:MJD2Y gives 2014
    • {{MJD2Y|54200}} gives 2007
    • {{MJD2Y|{{MJD}}-1000}} gives 2011, 1000 days ago
  • variable {{CURRENTDOW}} (1=Monday, .. , 6=Saturday, 0=Sunday) gives 4
  • with Template:DOW, {{DOW|2006|12|31}} gives 7
  • Template:Hour gives 14, two digits (00 - 23)
  • {{hour|12:43}} gives 12
  • {{hour|{{MJD}}}} gives 14
  • {{hour|{{MJD}}+1.25}} gives 20
  • Template:Minute gives 20, two digits (00 - 59)
  • {{minute|12:43}} gives 43
  • {{minute|{{MJD}}}} gives 20
  • {{minute|{{MJD}}+1.01}} gives 34
  • {{#expr:{{CURRENTTIMESTAMP}} mod 100}} gives 33, second
  • {{CURRENTCENTURY}}, current value: 21st century, no extra leading zero.
  • {{CURRENTISOYEAR}}, current value: 2014, no extra leading zero.

See also: