Template:Format time/doc

Syntax

Parameters

  • {{{hour}}} is required, and is the hour in 24 hour format.
    • aliases: {{{hh}}} and {{{1}}} (the first positional parameter)
  • {{{minute}}} is recommended; it is the minute after the hour (default 0).
    • aliases: {{{mm}}} and {{{2}}} (the second positional parameter)
  • {{{second}}} is optional; seconds will only be rendered if this is not blank.
    • aliases: {{{ss}}}, {{{sec}}} and {{{3}}} (the third positional parameter)
  • {{{TimeZone}}} may be a numerical value, or "Z" for UTC; see examples.
    • aliases: {{{timezone}}}, {{{tz}}} and {{{4}}} (the fourth positional parameter)
  • {{{hour_format}}} can be blank, 'h', 'H', 'g' or 'G'; see §§ Hour format​ and below.

Examples:


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:




See also

Multiple units of time

Type Adjustable Current Last Next
Date and time
Date only
Month and year only
Time only
  • {{Timeonly}} (Adjustable to 12 h format)
Banners
  • {{Right now}}
    (Blue with time and number of Wikipedia articles)
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

Individual templates

Categories of templates

Template Data

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Format time in articles based on its TemplateData.

TemplateData for Format time


Formats a time of day

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


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.

  1. 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:
  2. 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.
  3. 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.
  4. 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.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.