Hopp til innhold

Mal:ISOWEEKDAY

Fra Wikibøker – frie læremidler


{{subst:ISOWEEKDAY|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 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.


Eksempler

[rediger]
  • {{ISOWEEKDAY|2005|12|31}} gir 6

</noinclude>, og er ekvivalent med {{ISOWEEKDAY|2006|1|0}} gir 6

</noinclude>

  • {{ISOWEEKDAY|2006|1|1}} gir 7

</noinclude>

  • {{ISOWEEKDAY|2006|1|2}} gir 1

</noinclude>

Eksempel der ISO-året går tre dager inn i det neste gregorianske året

[rediger]
  • {{ISOWEEKDAY|2009|12|31}} gir 4

</noinclude>

  • {{ISOWEEKDAY|2010|1|1}} gir 5

</noinclude>

  • {{ISOWEEKDAY|2010|1|2}} gir 6

</noinclude>

  • {{ISOWEEKDAY|2010|1|3}} gir 7

</noinclude>

  • {{ISOWEEKDAY|2010|1|4}} gir 1

</noinclude>

Eksempel der ISO-året går tre dager inn i det foregående gregorianske året

[rediger]
  • {{ISOWEEKDAY|2008|12|28}} gir 7

</noinclude>

  • {{ISOWEEKDAY|2008|12|29}} gir 1

</noinclude>

  • {{ISOWEEKDAY|2008|12|30}} gir 2

</noinclude>

  • {{ISOWEEKDAY|2008|12|31}} gir 3

</noinclude>

  • {{ISOWEEKDAY|2009|1|1}} gir 4

</noinclude>

  • {{CURRENTDOW}} gives 0
  • integer MJD of Thursday of the week: Uttrykksfeil: Ugjenkjennelig skilletegn «[»
  • isoyear: Mal:MJD2Y
  • integer MJD of Thursday of the week of 1 Jan of the same year: Uttrykksfeil: Ugjenkjennelig skilletegn «[»
  • week number: Mal:Week

Mal:DOW name


Se også

[rediger]