Template talk:Utc: Difference between revisions

From Citizendium
Jump to navigation Jump to search
imported>Stephen Ewen
No edit summary
imported>Stephen Ewen
No edit summary
Line 19: Line 19:
: <tt><nowiki>{{</nowiki>Template:Utc<nowiki>|</nowiki>6<nowiki>|</nowiki>30<nowiki>}}</nowiki></tt> = "{{Utc|6|30}}".
: <tt><nowiki>{{</nowiki>Template:Utc<nowiki>|</nowiki>6<nowiki>|</nowiki>30<nowiki>}}</nowiki></tt> = "{{Utc|6|30}}".


Where I live it is {{Template:Utc|-4}}
;Optimal placement
 
Use with {{Tl|Usertime-text}}
 
;Example placement:
 
<nowiki>{{Usertime-text|John}}{{Template:Utc|-4}}</nowiki>
 
;Produces
{{Usertime-text|John}}{{Template:Utc|-4}}

Revision as of 22:14, 22 October 2007

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:
{{Template: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:
{{Template:Utc}} = "18:26".
{{Template:Utc|-4}} = "14:26".
{{Template:Utc|2}} = "20:26".
{{Template:Utc|6.5}} = "00:56".
{{Template:Utc|6|30}} = "00:56".
Optimal placement

Use with {{Usertime-text}}

Example placement

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

Produces

Hourglass drawing.svg Where John lives it is approximately: 14:26