Template:ISOWEEKDAY
From Wikipedia, the free encyclopedia
[edit] Template documentation
Contents |
[edit] Usage
{{subst:DOW|2006|1|3|subst=subst:}} gives the wikitext 2.
This template computes the ISO weekday number (1=Monday, 7=Sunday) for a given Gregorian date.
Alternative weekday number systems are:
- 1=Monday, .. , 6=Saturday, 0=Sunday, used by variable {{CURRENTDOW}}
- 0=Monday, .. , 5=Saturday, 6=Sunday, used by en:Template:WEEKDAY and
Syntax:
- {{DOW|year|month|day}}
- The year must be astronomical (year=1 in 1 AD (Anno Domini), year=0 in 1 BC, year=-1 in 2 BC).
- The month is between 1 and 12 from january to december.
- The day is normally between 1 and 31.
[edit] Examples
{{ISOWEEKDAY|2005|12|31}}
gives 6 [1] , and is eqv. with{{ISOWEEKDAY|2006|1|0}}
gives 6 [2]{{ISOWEEKDAY|2006|1|1}}
gives 7 [3]{{ISOWEEKDAY|2006|1|2}}
gives 1 [4]
[edit] Examples where the ISO year is three days into the next gregorian year
{{ISOWEEKDAY|2009|12|31}}
gives 4 [5]{{ISOWEEKDAY|2010|1|1}}
gives 5 [6]{{ISOWEEKDAY|2010|1|2}}
gives 6 [7]{{ISOWEEKDAY|2010|1|3}}
gives 7 [8]{{ISOWEEKDAY|2010|1|4}}
gives 1 [9]
[edit] Examples where the ISO year is three days into the previous gregorian year
{{ISOWEEKDAY|2008|12|28}}
gives 7 [10]{{ISOWEEKDAY|2008|12|29}}
gives 1 [11]{{ISOWEEKDAY|2008|12|30}}
gives 2 [12]{{ISOWEEKDAY|2008|12|31}}
gives 3 [13]{{ISOWEEKDAY|2009|1|1}}
gives 4 [14]
- {{CURRENTDOW}} gives 5
- integer MJD of Thursday of the week: Expression error: Unrecognised punctuation character "["
- isoyear: Template:MJD2Y
- integer MJD of Thursday of the week of 1 Jan of the same year: Expression error: Unrecognised punctuation character "["
- week number: Template:Week
Template:DOW name
[edit] See also
- Template based upon MediaWiki:Template:DOW
- Template:ISOWEEKDATE -
{{ISOWEEKDATE|2010|01|03}}
gives 2009-W53-7 [15] The opposite function of {{ISOWEEKDATE2YMD}}
-
- Template:ISOYEAR -
{{ISOYEAR|2010|01|03}}
gives 2009 [16] - Template:ISOWEEK -
{{ISOWEEK|2010|01|03}}
gives 53 [17] - Template:ISOWEEKDAY -
{{ISOWEEKDAY|2010|01|03}}
gives 7 [18]
- Template:ISOYEAR -
- Template:ISOWEEKDATE2YMD -
{{ISOWEEKDATE2YMD|2009|53|7}}
gives 2010-01-03 [19] The opposite function of {{ISOWEEKDATE}}
-
- Template:ISOWEEKDATE2Y -
{{ISOWEEKDATE2Y|2009|53|7}}
gives 2010 [20] - Template:ISOWEEKDATE2M -
{{ISOWEEKDATE2M|2009|53|7}}
gives 01 [21] - Template:ISOWEEKDATE2D -
{{ISOWEEKDATE2D|2009|53|7}}
gives 03 [22]
- Template:ISOWEEKDATE2Y -