Template talk:Utc: Difference between revisions

From Citizendium
Jump to navigation Jump to search
imported>Stephen Ewen
No edit summary
imported>J. Noel Chiappa
m (Unneeded Template:)
 
Line 7: Line 7:


; Syntax<nowiki>:</nowiki>
; Syntax<nowiki>:</nowiki>
: <tt><nowiki>{{</nowiki>Template:Utc<nowiki>|</nowiki>''[hours]''<nowiki>|</nowiki>''[minutes]''<nowiki>}}</nowiki></tt>
: <tt><nowiki>{{</nowiki>Utc<nowiki>|</nowiki>''[hours]''<nowiki>|</nowiki>''[minutes]''<nowiki>}}</nowiki></tt>
* The ''hours'' parameter (optional, default 0) is normally negative for America and West Pacific, it is null or positive in Europe, Africa, Asia and East Pacific.
* The ''hours'' parameter (optional, default 0) is normally negative for America and West Pacific, it is null or positive in Europe, Africa, Asia and East Pacific.
* The ''minutes'' parameter (optional, default 0) is null for most timezones, but 30 minutes occur in some places, sometimes because of daylight. Use negative values for western timezones that need it.
* The ''minutes'' parameter (optional, default 0) is null for most timezones, but 30 minutes occur in some places, sometimes because of daylight. Use negative values for western timezones that need it.
Line 13: Line 13:


; Examples<nowiki>:</nowiki>
; Examples<nowiki>:</nowiki>
: <tt><nowiki>{{</nowiki>Template:Utc<nowiki>}}</nowiki></tt> = "{{Utc}}".
: <tt><nowiki>{{</nowiki>Utc<nowiki>}}</nowiki></tt> = "{{Utc}}".
: <tt><nowiki>{{</nowiki>Template:Utc<nowiki>|</nowiki>-4<nowiki>}}</nowiki></tt> = "{{Utc|-4}}".
: <tt><nowiki>{{</nowiki>Utc<nowiki>|</nowiki>-4<nowiki>}}</nowiki></tt> = "{{Utc|-4}}".
: <tt><nowiki>{{</nowiki>Template:Utc<nowiki>|</nowiki>2<nowiki>}}</nowiki></tt> = "{{Utc|2}}".
: <tt><nowiki>{{</nowiki>Utc<nowiki>|</nowiki>2<nowiki>}}</nowiki></tt> = "{{Utc|2}}".
: <tt><nowiki>{{</nowiki>Template:Utc<nowiki>|</nowiki>6.5<nowiki>}}</nowiki></tt> = "{{Utc|6.5}}".
: <tt><nowiki>{{</nowiki>Utc<nowiki>|</nowiki>6.5<nowiki>}}</nowiki></tt> = "{{Utc|6.5}}".
: <tt><nowiki>{{</nowiki>Template:Utc<nowiki>|</nowiki>6<nowiki>|</nowiki>30<nowiki>}}</nowiki></tt> = "{{Utc|6|30}}".
: <tt><nowiki>{{</nowiki>Utc<nowiki>|</nowiki>6<nowiki>|</nowiki>30<nowiki>}}</nowiki></tt> = "{{Utc|6|30}}".


;Optimal placement
;Optimal placement
Line 25: Line 25:
;Example placement:
;Example placement:


<nowiki>{{Usertime-text|John}}{{Template:Utc|-4}}</nowiki>
<nowiki>{{Usertime-text|John}}{{Utc|-4}}</nowiki>


;Produces
;Produces
{{Usertime-text|John}}{{Template:Utc|-4}}
{{Usertime-text|John}}{{Utc|-4}}

Latest revision as of 09:11, 3 June 2008

Dependency

Is dependent with {{Usertime}}

Usage

{{Utc}} takes the current UTC time from the server, and applies an optional time offset in hours (or hours and minutes). It returns the computed local time in 24-hour format (hh:mm).

Syntax:
{{Utc|[hours]|[minutes]}}
  • The hours parameter (optional, default 0) is normally negative for America and West Pacific, it is null or positive in Europe, Africa, Asia and East Pacific.
  • The minutes parameter (optional, default 0) is null for most timezones, but 30 minutes occur in some places, sometimes because of daylight. Use negative values for western timezones that need it.
  • Non integers are accepted for both parameters, but this will be typically used only for hours offsets from UTC.
Examples:
{{Utc}} = "10:09".
{{Utc|-4}} = "06:09".
{{Utc|2}} = "12:09".
{{Utc|6.5}} = "16:39".
{{Utc|6|30}} = "16:39".
Optimal placement

Use with {{Usertime-text}}

Example placement

{{Usertime-text|John}}{{Utc|-4}}

Produces

Hourglass drawing.svg Where John lives it is approximately: 06:09