Misplaced Pages

Template:Day-1: Difference between revisions

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Browse history interactivelyContent deleted Content addedVisualWikitext
Revision as of 18:05, 22 March 2006 view sourceCBDunkerson (talk | contribs)Administrators15,422 edits Allows easy generation of yesterday's date  Latest revision as of 08:53, 8 April 2017 view source Jo-Jo Eumerus (talk | contribs)Autopatrolled, Administrators96,249 editsm Changed protection level for "Template:Day-1": Highly visible template: Allowing template editors ( (indefinite) (indefinite)) 
(27 intermediate revisions by 10 users not shown)
Line 1: Line 1:
{{{2|}}}{{#time: F{{{4| }}}j|{{{1|{{CURRENTMONTHNAME}} {{CURRENTDAY}}{{#if:{{{3|}}}|, {{{3}}}}}}}} +-{{{days|1}}} day}}{{#if:{{{3|}}}|,{{{4| }}}{{#switch:{{{1|{{CURRENTMONTHNAME}}{{{4| }}}{{CURRENTDAY}},{{{4| }}}{{{3}}}}}}|January{{{4| }}}{{{days|1}}},{{{4| }}}{{{3}}}={{#expr: {{{3|}}} - 1}}|{{{3|}}}}}}}<noinclude>{{Documentation}}</noinclude>
{{switch
|{{CURRENTMONTHNAME}} {{CURRENTDAY}}
|case: January 1=December 31
|case: January 2=January 1
|case: January 3=January 2
|case: January 4=January 3
|case: January 5=January 4
|case: January 6=January 5
|case: January 7=January 6
|case: January 8=January 7
|case: January 9=January 8
|case: January 10=January 9
|case: January 11=January 10
|case: January 12=January 11
|case: January 13=January 12
|case: January 14=January 13
|case: January 15=January 14
|case: January 16=January 15
|case: January 17=January 16
|case: January 18=January 17
|case: January 19=January 18
|case: January 20=January 19
|case: January 21=January 20
|case: January 22=January 21
|case: January 23=January 22
|case: January 24=January 23
|case: January 25=January 24
|case: January 26=January 25
|case: January 27=January 26
|case: January 28=January 27
|case: January 29=January 28
|case: January 30=January 29
|case: January 31=January 30
|case: February 1=January 31
|case: February 2=February 1
|case: February 3=February 2
|case: February 4=February 3
|case: February 5=February 4
|case: February 6=February 5
|case: February 7=February 6
|case: February 8=February 7
|case: February 9=February 8
|case: February 10=February 9
|case: February 11=February 10
|case: February 12=February 11
|case: February 13=February 12
|case: February 14=February 13
|case: February 15=February 14
|case: February 16=February 15
|case: February 17=February 16
|case: February 18=February 17
|case: February 19=February 18
|case: February 20=February 19
|case: February 21=February 20
|case: February 22=February 21
|case: February 23=February 22
|case: February 24=February 23
|case: February 25=February 24
|case: February 26=February 25
|case: February 27=February 26
|case: February 28=February 27
|case: February 29=February 28
|case: March 1={{unleap}}
|case: March 2=March 1
|case: March 3=March 2
|case: March 4=March 3
|case: March 5=March 4
|case: March 6=March 5
|case: March 7=March 6
|case: March 8=March 7
|case: March 9=March 8
|case: March 10=March 9
|case: March 11=March 10
|case: March 12=March 11
|case: March 13=March 12
|case: March 14=March 13
|case: March 15=March 14
|case: March 16=March 15
|case: March 17=March 16
|case: March 18=March 17
|case: March 19=March 18
|case: March 20=March 19
|case: March 21=March 20
|case: March 22=March 21
|case: March 23=March 22
|case: March 24=March 23
|case: March 25=March 24
|case: March 26=March 25
|case: March 27=March 26
|case: March 28=March 27
|case: March 29=March 28
|case: March 30=March 29
|case: March 31=March 30
|case: April 1=March 31
|case: April 2=April 1
|case: April 3=April 2
|case: April 4=April 3
|case: April 5=April 4
|case: April 6=April 5
|case: April 7=April 6
|case: April 8=April 7
|case: April 9=April 8
|case: April 10=April 9
|case: April 11=April 10
|case: April 12=April 11
|case: April 13=April 12
|case: April 14=April 13
|case: April 15=April 14
|case: April 16=April 15
|case: April 17=April 16
|case: April 18=April 17
|case: April 19=April 18
|case: April 20=April 19
|case: April 21=April 20
|case: April 22=April 21
|case: April 23=April 22
|case: April 24=April 23
|case: April 25=April 24
|case: April 26=April 25
|case: April 27=April 26
|case: April 28=April 27
|case: April 29=April 28
|case: April 30=April 29
|case: May 1=April 30
|case: May 2=May 1
|case: May 3=May 2
|case: May 4=May 3
|case: May 5=May 4
|case: May 6=May 5
|case: May 7=May 6
|case: May 8=May 7
|case: May 9=May 8
|case: May 10=May 9
|case: May 11=May 10
|case: May 12=May 11
|case: May 13=May 12
|case: May 14=May 13
|case: May 15=May 14
|case: May 16=May 15
|case: May 17=May 16
|case: May 18=May 17
|case: May 19=May 18
|case: May 20=May 19
|case: May 21=May 20
|case: May 22=May 21
|case: May 23=May 22
|case: May 24=May 23
|case: May 25=May 24
|case: May 26=May 25
|case: May 27=May 26
|case: May 28=May 27
|case: May 29=May 28
|case: May 30=May 29
|case: May 31=May 30
|case: June 1=May 31
|case: June 2=June 1
|case: June 3=June 2
|case: June 4=June 3
|case: June 5=June 4
|case: June 6=June 5
|case: June 7=June 6
|case: June 8=June 7
|case: June 9=June 8
|case: June 10=June 9
|case: June 11=June 10
|case: June 12=June 11
|case: June 13=June 12
|case: June 14=June 13
|case: June 15=June 14
|case: June 16=June 15
|case: June 17=June 16
|case: June 18=June 17
|case: June 19=June 18
|case: June 20=June 19
|case: June 21=June 20
|case: June 22=June 21
|case: June 23=June 22
|case: June 24=June 23
|case: June 25=June 24
|case: June 26=June 25
|case: June 27=June 26
|case: June 28=June 27
|case: June 29=June 28
|case: June 30=June 29
|case: July 1=June 30
|case: July 2=July 1
|case: July 3=July 2
|case: July 4=July 3
|case: July 5=July 4
|case: July 6=July 5
|case: July 7=July 6
|case: July 8=July 7
|case: July 9=July 8
|case: July 10=July 9
|case: July 11=July 10
|case: July 12=July 11
|case: July 13=July 12
|case: July 14=July 13
|case: July 15=July 14
|case: July 16=July 15
|case: July 17=July 16
|case: July 18=July 17
|case: July 19=July 18
|case: July 20=July 19
|case: July 21=July 20
|case: July 22=July 21
|case: July 23=July 22
|case: July 24=July 23
|case: July 25=July 24
|case: July 26=July 25
|case: July 27=July 26
|case: July 28=July 27
|case: July 29=July 28
|case: July 30=July 29
|case: July 31=July 30
|case: August 1=July 31
|case: August 2=August 1
|case: August 3=August 2
|case: August 4=August 3
|case: August 5=August 4
|case: August 6=August 5
|case: August 7=August 6
|case: August 8=August 7
|case: August 9=August 8
|case: August 10=August 9
|case: August 11=August 10
|case: August 12=August 11
|case: August 13=August 12
|case: August 14=August 13
|case: August 15=August 14
|case: August 16=August 15
|case: August 17=August 16
|case: August 18=August 17
|case: August 19=August 18
|case: August 20=August 19
|case: August 21=August 20
|case: August 22=August 21
|case: August 23=August 22
|case: August 24=August 23
|case: August 25=August 24
|case: August 26=August 25
|case: August 27=August 26
|case: August 28=August 27
|case: August 29=August 28
|case: August 30=August 29
|case: August 31=August 30
|case: September 1=August 31
|case: September 2=September 1
|case: September 3=September 2
|case: September 4=September 3
|case: September 5=September 4
|case: September 6=September 5
|case: September 7=September 6
|case: September 8=September 7
|case: September 9=September 8
|case: September 10=September 9
|case: September 11=September 10
|case: September 12=September 11
|case: September 13=September 12
|case: September 14=September 13
|case: September 15=September 14
|case: September 16=September 15
|case: September 17=September 16
|case: September 18=September 17
|case: September 19=September 18
|case: September 20=September 19
|case: September 21=September 20
|case: September 22=September 21
|case: September 23=September 22
|case: September 24=September 23
|case: September 25=September 24
|case: September 26=September 25
|case: September 27=September 26
|case: September 28=September 27
|case: September 29=September 28
|case: September 30=September 29
|case: October 1=September 30
|case: October 2=October 1
|case: October 3=October 2
|case: October 4=October 3
|case: October 5=October 4
|case: October 6=October 5
|case: October 7=October 6
|case: October 8=October 7
|case: October 9=October 8
|case: October 10=October 9
|case: October 11=October 10
|case: October 12=October 11
|case: October 13=October 12
|case: October 14=October 13
|case: October 15=October 14
|case: October 16=October 15
|case: October 17=October 16
|case: October 18=October 17
|case: October 19=October 18
|case: October 20=October 19
|case: October 21=October 20
|case: October 22=October 21
|case: October 23=October 22
|case: October 24=October 23
|case: October 25=October 24
|case: October 26=October 25
|case: October 27=October 26
|case: October 28=October 27
|case: October 29=October 28
|case: October 30=October 29
|case: October 31=October 30
|case: November 1=October 31
|case: November 2=November 1
|case: November 3=November 2
|case: November 4=November 3
|case: November 5=November 4
|case: November 6=November 5
|case: November 7=November 6
|case: November 8=November 7
|case: November 9=November 8
|case: November 10=November 9
|case: November 11=November 10
|case: November 12=November 11
|case: November 13=November 12
|case: November 14=November 13
|case: November 15=November 14
|case: November 16=November 15
|case: November 17=November 16
|case: November 18=November 17
|case: November 19=November 18
|case: November 20=November 19
|case: November 21=November 20
|case: November 22=November 21
|case: November 23=November 22
|case: November 24=November 23
|case: November 25=November 24
|case: November 26=November 25
|case: November 27=November 26
|case: November 28=November 27
|case: November 29=November 28
|case: November 30=November 29
|case: December 1=November 30
|case: December 2=December 1
|case: December 3=December 2
|case: December 4=December 3
|case: December 5=December 4
|case: December 6=December 5
|case: December 7=December 6
|case: December 8=December 7
|case: December 9=December 8
|case: December 10=December 9
|case: December 11=December 10
|case: December 12=December 11
|case: December 13=December 12
|case: December 14=December 13
|case: December 15=December 14
|case: December 16=December 15
|case: December 17=December 16
|case: December 18=December 17
|case: December 19=December 18
|case: December 20=December 19
|case: December 21=December 20
|case: December 22=December 21
|case: December 23=December 22
|case: December 24=December 23
|case: December 25=December 24
|case: December 26=December 25
|case: December 27=December 26
|case: December 28=December 27
|case: December 29=December 28
|case: December 30=December 29
|case: December 31=December 30
|default={{CURRENTMONTHNAME}} {{CURRENTDAY}}
}}

Latest revision as of 08:53, 8 April 2017

January 9

Template documentation[view] [edit] [history] [purge]
WarningThis template is used on approximately 8,400 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them.

{{day-1}} subtracts one from a date or date-specific pagename

Usage

{{Day-1}} - returns yesterday's date

{{Day-1|date}} - returns the day before the 'date' passed

{{Day-1|date|pagename|year|spacingchar}} - returns the name of the page one day before the 'datepage' passed in

Example
Code Result
{{Day-1}} January 9
{{Day-1|February 28}} February 27
{{Day-1|February 28|Misplaced Pages:Today's featured article/|2004}} Misplaced Pages:Today's featured article/February 27, 2004
{{day-1|{{day-1}}}} January 8
{{day-1|{{Currentmonthday}}|Misplaced Pages:Today's featured article/|{{CURRENTYEAR}}}} Misplaced Pages:Today's featured article/January 9, 2025
''[http://en.wikipedia.org/w/wiki.phtml?title=Misplaced Pages:POTD_row/{{day-1|4=_}},_{{CURRENTYEAR}}&action=edit Edit]'' Edit

See also

For the magic words with the same or similar names, see MediaWikiWiki:Help:Magic words § Date and time.

Multiple units of time

Type Adjustable Current Last Next
Date and time {{time}} {{Currentdate}} (MDY)
{{Plain now}} (DMY)
{{Now}} (DMY in a complete sentence)
{{Simple now}}
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}}
Month and year only {{Monthyear}} {{Monthyear-1}} {{Monthyear+1}}
Time only {{Timeonly}} {{CURRENTTIME}} (12 h format)
{{CURRENTTIME24}} (24 h format)
Banners {{Right now}}
(Blue with time and number of Misplaced Pages articles)
Timestamp {{Timestamp}}
(Format YYYYMMDDhhmmss)

Single units of time

Unit of time Adjustable Current Last Next
Second {{CURRENTSECOND}}
Minute {{CURRENTMINUTE}}
Hour {{CURRENTHOUR}}
Week {{CURRENTWEEK}}
{{CURRENTWEEKOFMONTH}}
Day of Week {{DAYOFWEEK}} {{CURRENTDAYNAME}}
{{CURRENTWEEKDAYABBREV}}
{{CURRENTWEEKDAY}}
Month {{MONTHNAME}}
{{MONTHABBREV}}
{{MONTHNUMBER}}
{{MONTH}} (zero padded)
{{CURRENTMONTHNAME}}
{{CURRENTMONTHABBREV}}
{{CURRENTMONTH1}}
{{CURRENTMONTHDAYS}}
{{LASTMONTHNAME}} {{NEXTMONTHNAME}}
Day of Month {{CURRENTDAY}}
{{CURRENTDAY2}} (zero padded)
Year {{CURRENTYEARCC}}
{{CURRENTYEARYY}}
{{CURRENTISOYEAR}}
{{CURRENTYEAR}}
{{LASTYEAR}} {{NEXTYEAR}}
Day of Year {{CURRENTDAYOFYEAR}}
Decade {{DECADE}} {{CURRENTDECADE}}
Century {{Century}} {{CURRENTCENTURY}}
MILLENNIUM {{MILLENNIUM}}

Date and time templates made for substitution:

Month:
{{Lmonth}} produces Dec
{{Nmonth}} produces Feb
{{Last month}} produces December 2024
{{Next month}} produces February 2025


Individual templates

Categories of templates

The above documentation is transcluded from Template:Day-1/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template. Categories: