Jump to content

Template talk:Revisedtime

Add topic
From Meta, a Wikimedia project coordination wiki
Latest comment: 18 years ago by Upssdr in topic History

Documentation

[edit]

Wikitext

[edit]
Note: No new line is in these templates.
Note: on this page the wikitext {{{a}}} is written as [a].

This Template:Revisedtime (talk, backlinks, edit) contains: (here the wikitext is too long, a short form is given)
{{revisedtime/h
|[[00:00|]|00][[00:01|]|00]...[[00:59|]|00][[01:00|]|01]...[[23:59|]|23]{{{1}}}=hourandtimezone
|=
}}:[[00:00|]|00][[00:01|]|01]...[[23:59|]|59]

and Template:Revisedtime/h (talk, backlinks, edit) contains: (here the wikitext is too long, a short form is given)
[[00-12|]|12]...[[00+12|]|12]
...
[[23-12|]|11]...[[23+12|]|11]

Purpose

[edit]

This template converts UTC time to your specified local time.

Mechanism

[edit]

Template:Revisedtime extract hour and minute from CURRENTTIME, and gives hour+timezone to Template:Revisedtime/h. Template:Revisedtime/h uses the array implementation method introduced in help:parameter default, and returns revised hour to Template:Revisedtime. Finally, Template:Revisedtime returns a revised hour and a colon and current minute.

Usage

[edit]
{{Revisedtime
  |your local timezone: -12,-11,...,-1,0,+1,...,+12
  |{{CURRENTTIME}} or a specified time=now
  |=
}}

Note: because of the cache mechanism, the result will not update automatically without purging or editing. So it's not suggested to use it as revised CURRENTTIME.

Examples

[edit]
  • {{Revisedtime|0|{{CURRENTTIME}}=now|=}} gives 06:47.
  • {{Revisedtime|+8|{{CURRENTTIME}}=now|=}} gives 14:47.
  • {{Revisedtime|0|{{subst:CURRENTTIME}}=now|=}} gives 07:25.
  • {{Revisedtime|+8|{{subst:CURRENTTIME}}=now|=}} gives 15:25.
  • {{Revisedtime|0|12:00=now|=}} gives 12:00.
  • {{Revisedtime|+8|12:00=now|=}} gives 20:00.

See also

[edit]

History

[edit]
Created
Upssdr 06:56, 7 February 2006 (UTC)Reply

Discussion

[edit]