Difference between revisions of "Template:Time"

From WikiMe @ iroiro.io
Jump to: navigation, search
ink>Kjhf
(UTC template for local time links. See https://en.wikipedia.org/wiki/Template:UTC_with_local_time_link)
 
m (7 revisions imported)
 
(6 intermediate revisions by one other user not shown)
Line 1: Line 1:
<span class="explain" title="Click to see in local time">[http://www.timeanddate.com/worldclock/fixedtime.html?hour={{{hour|{{{1|{{CURRENTHOUR}}}}}}}}&min={{{minute|{{{2|0}}}}}}&sec={{{second|0}}}{{#if:{{{day|}}}|&day={{{day}}}&month={{{month}}}&year={{{year}}}}} {{{hour|{{{1|{{CURRENTHOUR}}}}}}}}:{{{minute|{{{2|00}}}}}} UTC]</span><noinclude>
+
<includeonly>[https://www.timeanddate.com/worldclock/fixedtime.html?iso={{#time: Ymd"T"His | {{{1|}}} }} {{#time: H:i e | {{{1|}}} }}]</includeonly><noinclude>
 +
This template is used to keep time formatted consistently across the wiki.
 +
 
 +
It converts time input to [[wikipedia:Coordinated Universal Time|Coordinated Universal Time (UTC)]] and displays a link to a time conversion service for users to click and see when an event happened in their local time zone.
 +
 
 +
Complete documentation of the #time parser function that this template uses can be found at [[mw:Help:Extension:ParserFunctions|Help:Extension:ParserFunctions]].
  
 
== Usage ==
 
== Usage ==
{{t|UTC|hours (24 clock)|minutes}}
+
Enter time in the format: '''yyyy-mm-dd hh:mm time zone'''.
 +
: The time '''{{#time: Y-m-d H:i e }}''' is entered as <code><nowiki>{{time|</nowiki>{{#time: Y-m-d H:i e }}<nowiki>}}</nowiki></code>.
  
<nowiki>{{</nowiki>'''UTC'''&#124;<font color="gray">''hour=16''</font>&#124;<font color="gray">''minute=30''</font>&#124;<font color="gray">''year=2015''</font>&#124;<font color="gray">''month=12''</font>&#124;<font color="gray">''day=31''</font>}}
+
The template will convert non-UTC input to UTC.
 +
: <code><nowiki>{{time|2018-01-13 15:00 JST}}</nowiki></code> will be converted to {{time|2018-01-13 15:00 JST}}.
  
Use to label UTC date stamps.
+
If the date is not needed, time can be entered alone. The resulting link will assume today's date.
[[Category:Templates]]
+
: '''{{#time: H:i e }}''' is entered as <code><nowiki>{{time|</nowiki>{{#time: H:i e }}<nowiki>}}</nowiki></code>.
 +
[[Category:Formatting Templates]]
 
</noinclude>
 
</noinclude>

Latest revision as of 22:26, 17 May 2019

This template is used to keep time formatted consistently across the wiki.

It converts time input to Coordinated Universal Time (UTC) and displays a link to a time conversion service for users to click and see when an event happened in their local time zone.

Complete documentation of the #time parser function that this template uses can be found at Help:Extension:ParserFunctions.

Usage[edit]

Enter time in the format: yyyy-mm-dd hh:mm time zone.

The time 2025-12-22 01:00 UTC is entered as {{time|2025-12-22 01:00 UTC}}.

The template will convert non-UTC input to UTC.

{{time|2018-01-13 15:00 JST}} will be converted to 06:00 UTC.

If the date is not needed, time can be entered alone. The resulting link will assume today's date.

01:00 UTC is entered as {{time|01:00 UTC}}.