Difference between revisions of "Template:Format time/doc"

From blackwiki
Jump to navigation Jump to search
test>Daviddwd
test>Daviddwd
Line 3: Line 3:
 
== Usage ==
 
== Usage ==
  
== See also ==
 
  
 
==See also==
 
==See also==
Line 33: Line 32:
 
"minute": {
 
"minute": {
 
"aliases": [
 
"aliases": [
"min",
+
"mm",
 
"2"
 
"2"
 
],
 
],
Line 43: Line 42:
 
"suggested": true
 
"suggested": true
 
},
 
},
 
 
"second": {
 
"second": {
 
"aliases": [
 
"aliases": [
Line 60: Line 58:
 
"description": "Formats hours and whether to render AM/PM or a.m./p.m.",
 
"description": "Formats hours and whether to render AM/PM or a.m./p.m.",
 
"example": "g (7:00 p.m.), G (07:00 PM), h (19:00), or H (19:00)"
 
"example": "g (7:00 p.m.), G (07:00 PM), h (19:00), or H (19:00)"
 +
},
 +
"timezone": {
 +
"aliases": [
 +
"tz",
 +
"TimeZone",
 +
"4"
 +
],
 +
"description": "A numerical offset from UTC, or 'Z'. If non-empty, shows time zone",
 +
"example": "Z",
 +
"type": "string"
 
}
 
}
 
},
 
},
Line 66: Line 74:
 
"minute",
 
"minute",
 
"second",
 
"second",
"hour_format"
+
"hour_format",
]
+
"timezone"
 +
],
 +
"description": "If input, shows timezone"
 
}
 
}
 
</templatedata>
 
</templatedata>

Revision as of 19:30, 12 December 2018

Usage

See also

[edit] all subsections that follow:


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}}
Time only {{Timeonly}} {{CURRENTTIME}} (12 h format)
{{CURRENTTIME24}} (24 h format)
Banners {{Right now}}
(Blue 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 {{CURRENTWEEK}}
{{CURRENTWEEKOFMONTH}}
Day of Week {{Dow}} {{CURRENTDAYNAME}}
{{CURRENTWEEKDAYABBREV}}
{{CURRENTWEEKDAY}}
{{LASTWEEKDAYNAME}}
{{LASTWEEKDAYABBREV}}
{{NEXTWEEKDAYNAME}}
{{NEXTWEEKDAYABBREV}}
MONTH {{MONTHNAME}}
{{MONTHABBREV}}
{{MONTHNUMBER}}
{{MONTH}} (zero padded)
{{CURRENTMONTHNAME}}
{{CURRENTMONTHABBREV}}
{{CURRENTMONTH1}}
{{CURRENTMONTHDAYS}}
{{LASTMONTH}}
(Can make not zero-padded)
{{LASTMONTHNAME}}
{{LASTMONTHABBR}}
{{NEXTMONTH}}
(Can make not zero-padded)
{{NEXTMONTHNAME}}
{{NEXTMONTHABBR}}
Day of Month {{CURRENTDAY}}
{{CURRENTDAY2}} (zero padded)
YEAR {{CURRENTYEARCC}}
{{CURRENTYEARYY}}
{{CURRENTISOYEAR}}
{{CURRENTYEAR}}
{{LASTYEAR}} {{NEXTYEAR}}
Day of Year {{CURRENTDAYOFYEAR}}
DECADE {{DECADE}} {{CURRENTDECADE}} {{LASTDECADE}} {{NEXTDECADE}}
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 2025
{{NextMonth}} produces December 2025


Individual templates

Categories of templates

Template Data

This is the TemplateData documentation for this template used by VisualEditor and other tools; see the monthly parameter usage report for this template.

TemplateData for Format time


If input, shows timezone

Template parameters

ParameterDescriptionTypeStatus
Hourhour hh 1

Hour of the day, in 24 hour format

Example
13
Auto value
Numberrequired
Minuteminute mm 2

minutes after the hour

Example
3
Auto value
0
Numbersuggested
Secondsecond ss sec 3

Seconds after the minute

Numberoptional
Hour formathour_format

Formats hours and whether to render AM/PM or a.m./p.m.

Example
g (7:00 p.m.), G (07:00 PM), h (19:00), or H (19:00)
Stringsuggested
Timezonetimezone tz TimeZone 4

A numerical offset from UTC, or 'Z'. If non-empty, shows time zone

Example
Z
Stringoptional