Template:Weekday
This template computes the week day number (from 0 on Monday to 6 on Sunday) for the date of the Gregorian calendar (or proleptic) in parameter.
Syntax
- {{WEEKDAY|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.
The Julian day number (which is the integer part of the Julian day plus one) modulo 7 grows from 0 (on Monday at noon) to 6 (on Sunday at noon) and returns to 0 the next day on Monday at noon (however this template ignores time, so this number is valid for the whole day from zero o'clock to midnight). This numbering order matches the order of days in the ISO week (but NOT the absolute numeric value, and not the US week day order and numbering).
Examples
- {{WEEKDAY|2000|1|1}} returns 5
- {{WEEKDAY|2000|2|28}} returns 0
- {{WEEKDAY|2000|3|1}} returns 2
- {{WEEKDAY|2000|12|31}} returns 6
- {{WEEKDAY|2001|1|1}} returns 0
- {{WEEKDAY|2001|2|28}} returns 2
- {{WEEKDAY|2001|3|1}} returns 3
- {{WEEKDAY|2001|12|31}} returns 0
- {{WEEKDAY|2006|2|28}} returns 1
- {{WEEKDAY|2006|3|1}} returns 2
- {{WEEKDAY|2006|4|22}} returns 5
See also
Multiple units of time
Type | Adjustable | Current | Last | Next |
---|---|---|---|---|
Date and Time | {{time}} | {{Currentdate}} (MDY) {{Plain now}} (DMY) {{Now}} (Plan now in as sentence) |
||
Date Only | {{Dateonly}} {{Datedow}} (Has the day of the week) |
{{Date}} (Chose format) {{DATE}} (prefixed by date=) {{TODAY}} (DMY) |
{{Yesterday}} {{Day-1}} |
{{Tomorrow}} {{Day+1}} |
Time only | {{Timeonly}} | {{CURRENTTIME}} (12 h format) {{CURRENTTIME24}} (24 h format) |
||
Banners | {{Right now}} (Blue with time and number of Wikipedia articles) {{Right now (User message)}} (Orange with time and number of Wikipedia articles |
|||
Timestamp | {{Timestamp}} (Format YYYYMMDDHHMMSS) |
Single units of time
Unit of time | Adjustable | Current | Last | Next |
---|---|---|---|---|
SECOND | {{CURRENTSECOND}} | |||
MINUTE | {{CURRENTMINUTE}} | |||
HOUR | {{Currenthour}} | {{Hour-1}} | {{Hour+1}} | |
WEEK | {{CURRENTWEEKOFYEAR}} {{CURRENTWEEKOFMONTH}} |
|||
Day of Week | {{Dow}} | {{CURRENTWEEKDAYNAME}} {{CURRENTWEEKDAYABBREV}} {{CURRENTWEEKDAY}} |
{{LASTWEEKDAYNAME}} {{LASTWEEKDAYABBREV}} |
{{NEXTWEEKDAYNAME}} {{NEXTWEEKDAYABBREV}} |
MONTH | {{MONTHNAME}} {{MONTHABBREV}} {{MONTHNUMBER}} {{MONTH}} (zero padded) |
{{Currentmonth}} {{CURRENTMONTHABBREV}} {{CURRENTMONTHNUMBER}} {{CURRENTMONTHDAYS}} |
{{LASTMONTH}} (Can make not zero-padded) {{LASTMONTHNAME}} {{LASTMONTHABBR}} |
{{NEXTMONTH}} (Can make not zero-padded) {{NEXTMONTHNAME}} {{NEXTMONTHABBR}} |
Day of Month | {{Currentday}} | |||
YEAR | {{CURRENTYEARCC}} {{CURRENTYEARYY}} {{CURRENTISOYEAR}} {{CURRENTYEAR}} |
{{LASTYEAR}} | {{NEXTYEAR}} | |
Day of Year | {{CURRENTDAYOFYEAR}} | |||
CENTURY | {{CENTURY}} | {{CURRENTCENTURY}} | {{LASTCENTURY}} | {{NEXTCENTURY}} |
MILLENNIUM | {{MILLENNIUM}} | {{Currentmillennium}} |
Date and time Templates made for substitution:
Month:
{{Lmonth}} produces Oct
{{Nmonth}} produces Dec
{{LastMonth}} produces October 2024
{{NextMonth}} produces December 2024
Individual Templates
- {{Calendar}}
- {{Calendar clock with Wikipedia stats}}
- {{Clock}}
- {{Digital clock}}
- {{Digital clock and date}}
Categories of Templates
- Category:Time, date and calendar templates
- Category:Date-computing templates
- Category:Date-computing templates based on current time
- Category:ISO date templates
- Category:Calendar templates
- Category:Clock templates
bn:টেমপ্লেট:WEEKDAY
hsb:Předłoha:WEEKDAY
ja:Template:WEEKDAY
The above documentation is transcluded from Template:Weekday/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |