Template:Format time/doc
| This is a documentation subpage for Template:Format time. It may contain usage information, categories and other content that is not part of the original template page. |
Syntax
{{Format time|hour|minute|second}}{{Format time|hour|minute|second|TimeZone|hour_format=(format)}}
Parameters
{{{hour}}}is required, and is the hour in 24 hour format.- aliases:
{{{hh}}}and{{{1}}}(the first positional parameter)
- aliases:
{{{minute}}}is recommended; it is the minute after the hour (default 0).- aliases:
{{{mm}}}and{{{2}}}(the second positional parameter)
- aliases:
{{{second}}}is optional; seconds will only be rendered if this is not blank.- aliases:
{{{ss}}},{{{sec}}}and{{{3}}}(the third positional parameter)
- aliases:
{{{TimeZone}}}may be a numerical value, or "Z" for UTC; see examples.- aliases:
{{{timezone}}},{{{tz}}}and{{{4}}}(the fourth positional parameter)
- aliases:
{{{hour_format}}}can be blank, 'h', 'H', 'g' or 'G'; see §§ Hour format and below.
Examples:
{{Format time|08|30}}returns "08:30"{{Format time|08|30|23}}returns "08:30:23"{{Format time|08|30|tz=Z}}returns "08:30 (UTC)"{{Format time|08|30|23|timezone=+01:00}}returns "08:30:23 (+01:00)"{{Format time|08|30|23|TimeZone=-07:00}}returns "08:30:23 (-07:00)"
Hour format
The hour format parameter {{{hour_format}}} can be variously 'g', 'G', 'h', or 'H', specifying whether to use 12 hour time with AM/PM (g/h) or 24 hour time (G/H), and whether to truncate (g/G) numbers under 10 or not (h/H).
Examples:
{{Format time|08|30|hour_format=g}}returns "8:30 am"{{Format time|17|15|hour_format=g}}returns "5:15 pm"
{{Format time|08|30|hour_format=h}}returns "08:30 AM"{{Format time|17|15|hour_format=h}}returns "05:15 PM"
{{Format time|08|30|hour_format=G}}returns "8:30"{{Format time|17|15|hour_format=G}}returns "17:15"
{{Format time|08|30|hour_format=H}}returns "08:30"{{Format time|17|15|hour_format=H}}returns "17:15"
See also
- {{Format date}} for dates, with times optional
Multiple units of time
| Type | Adjustable | Current | Last | Next |
|---|---|---|---|---|
| Date and time |
|
|
||
| Date only | ||||
| Month and year only |
|
| ||
| Time only |
|
|
||
| Banners |
|
|||
| Timestamp |
|
Single units of time
| Unit of time | Adjustable | Current | Last | Next |
|---|---|---|---|---|
| Second |
|
|||
| Minute |
|
|||
| Hour |
|
|||
| Week |
|
|||
| Day of Week |
|
|
||
| Month |
|
|
|
|
| Day of Month |
|
|||
| Year |
|
|
| |
| Day of Year |
|
|||
| Decade |
|
|
||
| Century |
|
|
||
| Millenium |
|
Date and time templates made for substitution
Parser functions
- mw:Special:MyLanguage/time permits a custom time specifier string, similar to the C date and time functions
Individual templates
- {{Calendar}}
- {{Calendar clock with Wikipedia stats}}
- {{Clock}}
- {{Digital clock}}
- {{Digital clock and date}}
- {{Infobox calendar date today}}
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
Template Data
TemplateData for Format time
Formats a time of day
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Hour | hour hh 1 | Hour of the day, in 24 hour format
| Number | required |
| Minute | minute mm 2 | minutes after the hour
| Number | suggested |
| Second | second ss sec 3 | Seconds after the minute | Number | optional |
| Hour format | hour_format | Formats hours and whether to render AM/PM or a.m./p.m.
| String | suggested |
| timezone | timezone tz TimeZone 4 | A numerical offset from UTC, or 'Z'. If non-empty, shows time zone
| String | optional |
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.