Changes

Jump to navigation Jump to search
m
Capitalized proper adjectives.
{{Documentation subpage}}
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->

This template returns the cyclic integer weekday number (between 0 and 6) of the date whose number is in parameter. Alternatively, the day can be given with its English weekday name (complete or abbreviated to 3 characters, with capitals or small letters).

; Syntax<nowiki>:</nowiki>
: <tt><nowiki>{{</nowiki>WEEKDAYNUMBER|</tt>''day''<tt>}}</tt>
* The ''day'' value can be any numeric expression and is interpreted modulo 7 (extra leading zeroes and decimals are ignored), so it accepts any valid Julian day timestamp.

; Example with a Julian day timestamp<nowiki>:</nowiki>
: <tt><nowiki>{{WEEKDAYNUMBER|{{JULIANDAY|2000|01|01}}}}</nowiki></tt> returns {{WEEKDAYNUMBER|{{JULIANDAY|2000|01|01}}}}.

; Note<nowiki>:</nowiki>
: The returned value is ordered from 0 to 6 according to the ISO week (Monday to Sunday), and is consistent with date computing with Julian day, ISO week or ISO year computations. Use another template to convert it to traditional US week numbers, by adding 5, reducing the result with modulo 7 and, if needed, adding 1 to the result for a range between 1 and 7.

; Examples for all standard English week day names<nowiki>:</nowiki>
: <tt><nowiki>{{WEEKDAYNUMBER|monday}}</nowiki></tt> returns {{WEEKDAYNUMBER|monday}}
: <tt><nowiki>{{WEEKDAYNUMBER|tuesday}}</nowiki></tt> returns {{WEEKDAYNUMBER|tuesday}}
: <tt><nowiki>{{WEEKDAYNUMBER|wednesday}}</nowiki></tt> returns {{WEEKDAYNUMBER|wednesday}}
: <tt><nowiki>{{WEEKDAYNUMBER|thursday}}</nowiki></tt> returns {{WEEKDAYNUMBER|thursday}}
: <tt><nowiki>{{WEEKDAYNUMBER|friday}}</nowiki></tt> returns {{WEEKDAYNUMBER|friday}}
: <tt><nowiki>{{WEEKDAYNUMBER|saturday}}</nowiki></tt> returns {{WEEKDAYNUMBER|saturday}}
: <tt><nowiki>{{WEEKDAYNUMBER|sunday}}</nowiki></tt> returns {{WEEKDAYNUMBER|sunday}}

; Examples for all abbreviated English week day names<nowiki>:</nowiki>
: <tt><nowiki>{{WEEKDAYNUMBER|mon}}</nowiki></tt> returns {{WEEKDAYNUMBER|mon}}
: <tt><nowiki>{{WEEKDAYNUMBER|tue}}</nowiki></tt> returns {{WEEKDAYNUMBER|tue}}
: <tt><nowiki>{{WEEKDAYNUMBER|wed}}</nowiki></tt> returns {{WEEKDAYNUMBER|wed}}
: <tt><nowiki>{{WEEKDAYNUMBER|thu}}</nowiki></tt> returns {{WEEKDAYNUMBER|thu}}
: <tt><nowiki>{{WEEKDAYNUMBER|fri}}</nowiki></tt> returns {{WEEKDAYNUMBER|fri}}
: <tt><nowiki>{{WEEKDAYNUMBER|sat}}</nowiki></tt> returns {{WEEKDAYNUMBER|sat}}
: <tt><nowiki>{{WEEKDAYNUMBER|sun}}</nowiki></tt> returns {{WEEKDAYNUMBER|sun}}

; Examples for all standard week day numbers<nowiki>:</nowiki>
: <tt><nowiki>{{WEEKDAYNUMBER|0}}</nowiki></tt> returns {{WEEKDAYNUMBER|0}}
: <tt><nowiki>{{WEEKDAYNUMBER|1}}</nowiki></tt> returns {{WEEKDAYNUMBER|1}}
: <tt><nowiki>{{WEEKDAYNUMBER|2}}</nowiki></tt> returns {{WEEKDAYNUMBER|2}}
: <tt><nowiki>{{WEEKDAYNUMBER|3}}</nowiki></tt> returns {{WEEKDAYNUMBER|3}}
: <tt><nowiki>{{WEEKDAYNUMBER|4}}</nowiki></tt> returns {{WEEKDAYNUMBER|4}}
: <tt><nowiki>{{WEEKDAYNUMBER|5}}</nowiki></tt> returns {{WEEKDAYNUMBER|5}}
: <tt><nowiki>{{WEEKDAYNUMBER|6}}</nowiki></tt> returns {{WEEKDAYNUMBER|6}}

; Examples for week day numbers with extra leading zero<nowiki>:</nowiki>
: <tt><nowiki>{{WEEKDAYNUMBER|00}}</nowiki></tt> returns {{WEEKDAYNUMBER|00}}
: <tt><nowiki>{{WEEKDAYNUMBER|01}}</nowiki></tt> returns {{WEEKDAYNUMBER|01}}
: <tt><nowiki>{{WEEKDAYNUMBER|02}}</nowiki></tt> returns {{WEEKDAYNUMBER|02}}
: <tt><nowiki>{{WEEKDAYNUMBER|03}}</nowiki></tt> returns {{WEEKDAYNUMBER|03}}
: <tt><nowiki>{{WEEKDAYNUMBER|04}}</nowiki></tt> returns {{WEEKDAYNUMBER|04}}
: <tt><nowiki>{{WEEKDAYNUMBER|05}}</nowiki></tt> returns {{WEEKDAYNUMBER|05}}
: <tt><nowiki>{{WEEKDAYNUMBER|06}}</nowiki></tt> returns {{WEEKDAYNUMBER|06}}

; Examples for week day number underflows and overflows, from computed values<nowiki>:</nowiki>
: <tt><nowiki>{{WEEKDAYNUMBER|-700}}</nowiki></tt> returns {{WEEKDAYNUMBER|-700}}
: <tt><nowiki>{{WEEKDAYNUMBER|-701}}</nowiki></tt> returns {{WEEKDAYNUMBER|-701}}
: <tt><nowiki>{{WEEKDAYNUMBER|-707}}</nowiki></tt> returns {{WEEKDAYNUMBER|-707}}
: <tt><nowiki>{{WEEKDAYNUMBER|-7}}</nowiki></tt> returns {{WEEKDAYNUMBER|-7}}
: <tt><nowiki>{{WEEKDAYNUMBER|-6}}</nowiki></tt> returns {{WEEKDAYNUMBER|-6}}
: <tt><nowiki>{{WEEKDAYNUMBER|-5}}</nowiki></tt> returns {{WEEKDAYNUMBER|-5}}
: <tt><nowiki>{{WEEKDAYNUMBER|-4}}</nowiki></tt> returns {{WEEKDAYNUMBER|-4}}
: <tt><nowiki>{{WEEKDAYNUMBER|-3}}</nowiki></tt> returns {{WEEKDAYNUMBER|-3}}
: <tt><nowiki>{{WEEKDAYNUMBER|-2}}</nowiki></tt> returns {{WEEKDAYNUMBER|-2}}
: <tt><nowiki>{{WEEKDAYNUMBER|-1}}</nowiki></tt> returns {{WEEKDAYNUMBER|-1}}
: <tt><nowiki>{{WEEKDAYNUMBER|-0.9999}}</nowiki></tt> returns {{WEEKDAYNUMBER|-0.9999}}
: <tt><nowiki>{{WEEKDAYNUMBER|-0.5}}</nowiki></tt> returns {{WEEKDAYNUMBER|-0.5}}
: <tt><nowiki>{{WEEKDAYNUMBER|-0.0001}}</nowiki></tt> returns {{WEEKDAYNUMBER|-0.0001}}
: <tt><nowiki>{{WEEKDAYNUMBER|0}}</nowiki></tt> returns {{WEEKDAYNUMBER|0}}
: <tt><nowiki>{{WEEKDAYNUMBER|0.0001}}</nowiki></tt> returns {{WEEKDAYNUMBER|0.0001}}
: <tt><nowiki>{{WEEKDAYNUMBER|0.5}}</nowiki></tt> returns {{WEEKDAYNUMBER|0}}
: <tt><nowiki>{{WEEKDAYNUMBER|0.9999}}</nowiki></tt> returns {{WEEKDAYNUMBER|0.9999}}
: <tt><nowiki>{{WEEKDAYNUMBER|6.0001}}</nowiki></tt> returns {{WEEKDAYNUMBER|6.0001}}
: <tt><nowiki>{{WEEKDAYNUMBER|6.5}}</nowiki></tt> returns {{WEEKDAYNUMBER|6.5}}
: <tt><nowiki>{{WEEKDAYNUMBER|6.9999}}</nowiki></tt> returns {{WEEKDAYNUMBER|6.9999}}
: <tt><nowiki>{{WEEKDAYNUMBER|7}}</nowiki></tt> returns {{WEEKDAYNUMBER|7}}
: <tt><nowiki>{{WEEKDAYNUMBER|8}}</nowiki></tt> returns {{WEEKDAYNUMBER|8}}
: <tt><nowiki>{{WEEKDAYNUMBER|14}}</nowiki></tt> returns {{WEEKDAYNUMBER|14}}
: <tt><nowiki>{{WEEKDAYNUMBER|700}}</nowiki></tt> returns {{WEEKDAYNUMBER|700}}
: <tt><nowiki>{{WEEKDAYNUMBER|701}}</nowiki></tt> returns {{WEEKDAYNUMBER|701}}
: <tt><nowiki>{{WEEKDAYNUMBER|707}}</nowiki></tt> returns {{WEEKDAYNUMBER|707}}

; Example for invalid week day name<nowiki>:</nowiki>
: <tt><nowiki>{{WEEKDAYNUMBER|xxx}}</nowiki></tt> returns {{WEEKDAYNUMBER|xxx}}

; See also<nowiki>:</nowiki>
: [[Template:WEEKDAYNAME]]
: [[Template:WEEKDAYABBREV]]
: [[Template:WEEKDAY]]
: [[Template:CURRENTWEEKDAY]]

<includeonly>
<!-- ADD CATEGORIES BELOW THIS LINE -->

<!-- ADD INTERWIKIS BELOW THIS LINE -->

</includeonly>
Anonymous user

Navigation menu