This site is supported by donations to The OEIS Foundation.
Template:Day
From OeisWiki
The following documentation is located at Template:Day/doc. [<Edit> Template:Day/doc]
[⧼Purge⧽ Template:Day]
[⧼Purge⧽ Template:Day]
The {{day}} date and time function template changes a full weekday name, a standard three letter weekday abbreviation or a weekday number from 0 to 6, with or without a leading zero, to the standard three letter weekday abbreviation.
Contents
Usage
- {{day|a full weekday name, a standard three letter weekday abbreviation or a weekday number from 0 to 6, with or without a leading zero}}
or
- {{day}} which defaults to local standard three letter weekday abbreviation of OEIS Wiki server
Examples
Examples with valid input
Code Result {{day|monday}} Mon {{day|Monday}} Mon {{day|WEDNESDAY}} Wed {{day|tue}} Tue {{day|0}} Sun {{day|4}} Thu {{day|06}} Sat {{day|001}} Mon {{day}} Thu
Examples with invalid input
Code Result {{day|Hexday}} Day error: invalid input {{day|7}} Day error: invalid input {{day|-1}} Day error: invalid input {{day|6.5}} Day error: invalid input
Code
<!-- The second column will have its use! For the third column, the leading zeros are ignored. --> {{#switch: {{lc: {{{1|{{LOCALDAYNAME}}}}} }} | sunday=Sun | sun=Sun | 0=Sun | monday=Mon | mon=Mon | 1=Mon | tuesday=Tue | tue=Tue | 2=Tue | wednesday=Wed | wed=Wed | 3=Wed | thursday=Thu | thu=Thu | 4=Thu | friday=Fri | fri=Fri | 5=Fri | saturday=Sat | sat=Sat | 6=Sat | {{error| Day error: invalid input}} }}
See also
- {{daynum}} gives the weekday number (0 to 6) for (Sun to Sat)
- {{day}} gives the standard three letter weekday abbreviation.
- {{fullday}} gives the full weekday name.
- {{monthnum}} gives the month number (padded left with 0 if necessary to get two decimal digits) (01 to 12)
- {{month}} gives the standard three letter month abbreviation.
- {{fullmonth}} gives the full month name.
- {{days in month}} (or {{monthdays}}) gives the number of days in a month (for any year from 1 AD to 10000 AD)
- {{yearday}} returns the day of year from year, month and monthday (for any year from 1 AD to 10000 AD)
- {{ifleapyear}} or {{if leap year}} returns different values depending on whether a given year is a leap year or a common year (for any year from 1 AD to 10000 AD)
- {{is leap year}} predicate function template returns 1 (if true) or 0 (if false) depending on whether a given year is a leap year or a common year (for any year from 1 AD to 10000 AD)
- {{Century}} returns the century for any nonzero (negative or positive) year
- {{Millennium}} returns the millennium for any nonzero (negative or positive) year
- {{to day of CE}} returns the day of CE (Christ Era) from year, month and monthday (for any year from 1 AD to 10000 AD)
- {{from day of CE}} returns year, month and monthday (for any year from 1 AD to 10000 AD) from the day of CE (Christ Era)
- {{date}} for date mathematics (for any year from 1 AD to 10000 AD) (returns the date offset a specified number of days from a given date)
- {{days between}} for date mathematics (for any years from 1 AD to 10000 AD) (returns the number of days between two dates)