Changes
Jump to navigation
Jump to search
Template:Current hour in time zone/doc (view source)
Revision as of 21:04, 30 September 2018
, 6 years ago→Related templates
{{Documentation subpage}}
This template gives the current hour in the given [[time zone]] in [[24-hour clock|24-hour]] format.
It makes use of {{tl|Current hour offset in time zone}} which, unless the <code>dst</code> parameter is used, automatically adjusts the hour according to [[daylight saving time]] (DST), if applicable. It also makes use of {{tl|Current minute offset in time zone}}.
This template can be used in conjunction with {{tl|Current minute in time zone}} to get the current time in a particular time zone. See below for the currently supported time zones.
==Usage==
{{Pre|{{((}}Current hour in time zone{{!}}''time zone''<span style{{=}}"color:#777">[</span>{{!}}dst{{=}}''no''<span style{{=}}"color:#777">]</span>{{))}}}}
:(<code><span style{{=}}"color:#777">[</span>...<span style{{=}}"color:#777">]</span></code> means ''optional'', do not include the square brackets when using this template)
where
*''time zone'' is the desired time zone abbreviation (see below and also the [[list of time zone abbreviations]]);<br />If no time zone is given or if the given time zone is not supported, then the output will default to the current hour of [[UTC±0]] time;<br />In this case, instead of giving a time zone, an '''offset''' (e.g. -3, 1, 5, etc.) can also be given to get the current hour of UTC+''offset'' time (which will not be adjusted according to DST);
*<code>{{abbr|dst|The previous name of this parameter 'autoDST' can still be used}}</code> is an optional parameter to disable automatic daylight saving time adjustment by setting the value to "no";<br />If a DST variant of a particular time zone exists, then the time is automatically adjusted according to DST by default.
==Supported time zones==
Currently the time zones '''that appear in both tables below''' are supported:
;Hour offset
{{Current hour offset in time zone/doc|table}}
;Minute offset
{{Current minute offset in time zone/doc|table}}
==Time zone map==
[[File:Worldwide Time Zones (including DST).png|center|800px]]
==Examples==
<small>(You may want to {{Purge|purge}} this page to update the output.)</small>
<pre>*{{Current hour in time zone|CET}}</pre>
produces
*{{Current hour in time zone|CET}}
<pre>*{{Current hour in time zone|CET|dst=no}}</pre>
produces
*{{Current hour in time zone|CET|dst=no}}
<pre>*{{Current hour in time zone|CEST}}</pre>
produces
*{{Current hour in time zone|CEST}}
<pre>*{{Current hour in time zone|CEST|dst=no}}</pre>
produces
*{{Current hour in time zone|CEST|dst=no}}
<pre>*{{Current hour in time zone|PT}}</pre>
produces
*{{Current hour in time zone|PT}}
<pre>*{{Current hour in time zone|-4}}</pre>
produces
*{{Current hour in time zone|-4}}
<pre>*{{Current hour in time zone}}</pre>
produces
*{{Current hour in time zone}}
<pre>*{{Current hour in time zone|ACT}}:{{Current minute in time zone|ACT}}</pre>
produces
*{{Current hour in time zone|ACT}}:{{Current minute in time zone|ACT}}
==Related templates==
{{Current time templates}}
This template gives the current hour in the given [[time zone]] in [[24-hour clock|24-hour]] format.
It makes use of {{tl|Current hour offset in time zone}} which, unless the <code>dst</code> parameter is used, automatically adjusts the hour according to [[daylight saving time]] (DST), if applicable. It also makes use of {{tl|Current minute offset in time zone}}.
This template can be used in conjunction with {{tl|Current minute in time zone}} to get the current time in a particular time zone. See below for the currently supported time zones.
==Usage==
{{Pre|{{((}}Current hour in time zone{{!}}''time zone''<span style{{=}}"color:#777">[</span>{{!}}dst{{=}}''no''<span style{{=}}"color:#777">]</span>{{))}}}}
:(<code><span style{{=}}"color:#777">[</span>...<span style{{=}}"color:#777">]</span></code> means ''optional'', do not include the square brackets when using this template)
where
*''time zone'' is the desired time zone abbreviation (see below and also the [[list of time zone abbreviations]]);<br />If no time zone is given or if the given time zone is not supported, then the output will default to the current hour of [[UTC±0]] time;<br />In this case, instead of giving a time zone, an '''offset''' (e.g. -3, 1, 5, etc.) can also be given to get the current hour of UTC+''offset'' time (which will not be adjusted according to DST);
*<code>{{abbr|dst|The previous name of this parameter 'autoDST' can still be used}}</code> is an optional parameter to disable automatic daylight saving time adjustment by setting the value to "no";<br />If a DST variant of a particular time zone exists, then the time is automatically adjusted according to DST by default.
==Supported time zones==
Currently the time zones '''that appear in both tables below''' are supported:
;Hour offset
{{Current hour offset in time zone/doc|table}}
;Minute offset
{{Current minute offset in time zone/doc|table}}
==Time zone map==
[[File:Worldwide Time Zones (including DST).png|center|800px]]
==Examples==
<small>(You may want to {{Purge|purge}} this page to update the output.)</small>
<pre>*{{Current hour in time zone|CET}}</pre>
produces
*{{Current hour in time zone|CET}}
<pre>*{{Current hour in time zone|CET|dst=no}}</pre>
produces
*{{Current hour in time zone|CET|dst=no}}
<pre>*{{Current hour in time zone|CEST}}</pre>
produces
*{{Current hour in time zone|CEST}}
<pre>*{{Current hour in time zone|CEST|dst=no}}</pre>
produces
*{{Current hour in time zone|CEST|dst=no}}
<pre>*{{Current hour in time zone|PT}}</pre>
produces
*{{Current hour in time zone|PT}}
<pre>*{{Current hour in time zone|-4}}</pre>
produces
*{{Current hour in time zone|-4}}
<pre>*{{Current hour in time zone}}</pre>
produces
*{{Current hour in time zone}}
<pre>*{{Current hour in time zone|ACT}}:{{Current minute in time zone|ACT}}</pre>
produces
*{{Current hour in time zone|ACT}}:{{Current minute in time zone|ACT}}
==Related templates==
{{Current time templates}}