Difference between revisions of "Template:Daylight saving active"
imported>Thayts (-IST due to abbr. collisions) |
imported>Thayts |
||
| Line 1: | Line 1: | ||
| − | {{#switch:{{uc:{{{1|}}}}} | + | <!-- |
| + | HOW TO ADD A TIME ZONE | ||
| + | |||
| + | * Add a pipe (|) chain with all the abbreviations of the time zones | ||
| + | for which the same formula is used to calculate the dates at which | ||
| + | DST begins and ends, including both the standard time abbreviation(s) | ||
| + | and daylight saving time abbreviation for each time zone, ending the | ||
| + | chain with an equal sign (=) followed by the formula. | ||
| + | |||
| + | * Update the documentation. | ||
| + | |||
| + | * Also update the technical documentation, found at /techdoc, to | ||
| + | describe at what date and time DST begins and ends as implemented in | ||
| + | the formula. | ||
| + | |||
| + | -->{{#switch:{{uc:{{{1|}}}}} | ||
| + | |||
<!--Hawaii Standard Time--> | <!--Hawaii Standard Time--> | ||
| − | |HST= | + | |HST=0 <!--no DST--> |
| − | + | ||
<!--Hawaii-Aleutian Time--> | <!--Hawaii-Aleutian Time--> | ||
|HAT|HAST|HADT | |HAT|HAST|HADT | ||
| + | |||
<!--Alaska Time--> | <!--Alaska Time--> | ||
|AKT|AKST|AKDT | |AKT|AKST|AKDT | ||
| + | |||
<!--Pacific Time (Northern America)--> | <!--Pacific Time (Northern America)--> | ||
|PT|PST|PDT | |PT|PST|PDT | ||
| + | |||
<!--Mountain Time (Northern America)--> | <!--Mountain Time (Northern America)--> | ||
|MT|MST|MDT | |MT|MST|MDT | ||
| + | |||
<!--Central Time (Northern America)--> | <!--Central Time (Northern America)--> | ||
|CT|CST|CDT | |CT|CST|CDT | ||
| + | |||
<!--Eastern Time (Northern America)--> | <!--Eastern Time (Northern America)--> | ||
|ET|EST|EDT | |ET|EST|EDT | ||
| + | |||
<!--Atlantic Time--> | <!--Atlantic Time--> | ||
|AT|AST|ADT | |AT|AST|ADT | ||
| + | |||
<!--Newfoundland Time--> | <!--Newfoundland Time--> | ||
|NT|NST|NDT= | |NT|NST|NDT= | ||
| Line 33: | Line 56: | ||
|0 <!--DST not active--> | |0 <!--DST not active--> | ||
}} | }} | ||
| + | |||
<!--Greenwich Mean Time / British Summer Time (same as WET / WEST)--> | <!--Greenwich Mean Time / British Summer Time (same as WET / WEST)--> | ||
|GMT|BST | |GMT|BST | ||
| + | |||
<!--Western European Time--> | <!--Western European Time--> | ||
|WET|WEST | |WET|WEST | ||
| + | |||
<!--Central European Time--> | <!--Central European Time--> | ||
|CET|CEST | |CET|CEST | ||
| + | |||
<!--Eastern European Time--> | <!--Eastern European Time--> | ||
|EET|EEST= | |EET|EEST= | ||
| Line 55: | Line 82: | ||
|0 <!--DST not active--> | |0 <!--DST not active--> | ||
}} | }} | ||
| + | |||
<!--Australian Western Time--> | <!--Australian Western Time--> | ||
| − | |AWT|AWST= | + | |AWT|AWST=0 <!--no DST--> |
| − | + | ||
<!--Australian Central Time--> | <!--Australian Central Time--> | ||
|ACT|ACST|ACDT | |ACT|ACST|ACDT | ||
| + | |||
<!--Australian Eastern Time--> | <!--Australian Eastern Time--> | ||
|AET|AEST|AEDT= | |AET|AEST|AEDT= | ||
| Line 76: | Line 105: | ||
|0 <!--DST not active--> | |0 <!--DST not active--> | ||
}} | }} | ||
| + | |||
<!--Korea Standard Time--> | <!--Korea Standard Time--> | ||
| − | |KST | + | |KST=0 <!--no DST--> |
| + | |||
<!--Japan Standard Time--> | <!--Japan Standard Time--> | ||
| − | |JST= | + | |JST=0 <!--no DST--> |
| − | + | ||
<!--New Zealand Time--> | <!--New Zealand Time--> | ||
|NZT|NZST|NZDT= | |NZT|NZST|NZDT= | ||
| Line 97: | Line 128: | ||
|0 <!--DST not active--> | |0 <!--DST not active--> | ||
}} | }} | ||
| + | |||
<!--default--> | <!--default--> | ||
|0 | |0 | ||
Revision as of 19:59, 29 September 2012
0
This template returns either 0 or 1 to indicate if daylight saving time (DST) is active in the given time zone region:
| 0 | DST is not active |
| 1 | DST is active |
See below for the currently supported time zones. Note that if DST is only partially observed in a certain time zone, this template returns 1 if DST is active in that part (even though it is not observed/active in the other part).
During DST, the clock is set one hour ahead of standard time.
Contents
Usage
{{Daylight saving in time zone | time zone abbreviation | date/time value}}
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| time zone abbreviation | 1 | Abbreviation of the time zone for which it is determined if DST is active. If no time zone is given or if the given time zone is not supported, then the output will default to 0.
| String | suggested |
| date/time value | 2 | Date and time for which it is determined if DST would be active in the given time zone. By default, if no value is given, it is determined if DST is active at the current time.
| Date | optional |
Supported time zones
From the list of time zone abbreviations, the following time zones are currently supported:
| Standard time abbreviation Abbreviations Daylight saving time abbreviation | Name | Standard time offset Script error: No such module "Purge". Daylight saving time offset | Notes | ||
|---|---|---|---|---|---|
| HST | Hawaii Standard Time | UTC−10:00 | The *T, *ST and *DT variants of a particular time zone are considered the same region and will produce the same output, thus they can be used interchangeably.
DST is not observed in Hawaii and in Saskatchewan, Canada (except Lloydminster, SK, where MST/MDT is observed). | ||
| HAT or HAST | HADT | Hawaii-Aleutian Standard/Daylight Time | UTC−10:00 | UTC−09:00 | |
| AKT or AKST | AKDT | Alaska Standard/Daylight Time | UTC−09:00 | UTC−08:00 | |
| PT or PST | PDT | Pacific Standard/Daylight Time | UTC−08:00 | UTC−07:00 | |
| MT or MST | MDT | Mountain Standard/Daylight Time | UTC−07:00 | UTC−06:00 | |
| SKT or SKST | Saskatchewan Standard Time | UTC−06:00 | |||
| CT or CST | CDT | Central Standard/Daylight Time | UTC−06:00 | UTC−05:00 | |
| ET or EST | EDT | Eastern Standard/Daylight Time | UTC−05:00 | UTC−04:00 | |
| AT or AST | ADT | Atlantic Standard/Daylight Time | UTC−04:00 | UTC−03:00 | |
| NT or NST | NDT | Newfoundland Standard/Daylight Time | UTC−03:30 | UTC−02:30 | |
| GMT | BST | Greenwich Mean Time / British Summer Time |
UTC+00:00 | UTC+01:00 | Both the GMT and BST variants of this time zone are considered the same region and will produce the same output, thus they can be used interchangeably.
This time zone is essentially the same as WET/WEST, see below for more details. |
| WET | WEST | Western European (Summer) Time | UTC+00:00 | UTC+01:00 | Both the *ET and *EST variants of a particular time zone are considered the same region and will produce the same output, thus they can be used interchangeably. |
| CET | CEST | Central European (Summer) Time | UTC+01:00 | UTC+02:00 | |
| EET | EEST | Eastern European (Summer) Time | UTC+02:00 | UTC+03:00 | |
| AWT or AWST | Australian Western Standard Time | UTC+08:00 | The *T, *ST and *DT variants of a particular time zone are considered the same region and will produce the same output, thus they can be used interchangeably.
DST is not observed in the AWT time zone. | ||
| ACT or ACST | ACDT | Australian Central Standard/Daylight Time | UTC+09:30 | UTC+10:30 | |
| AET or AEST | AEDT | Australian Eastern Standard/Daylight Time | UTC+10:00 | UTC+11:00 | |
| KST | Korea Standard Time | UTC+09:00 | DST is not observed in these time zones. | ||
| JST | Japan Standard Time | UTC+09:00 | |||
| NZT or NZST | NZDT | New Zealand Standard/Daylight Time | UTC+12:00 | UTC+13:00 | The NZT, NZST and NZDT variants of this time zone are considered the same region and will produce the same output, thus they can be used interchangeably. |
Time zone map
Examples
(You may want to Script error: No such module "Purge". this page to update the output.)
*{{Daylight saving in time zone|CET}}
produces
- 1
*{{Daylight saving in time zone|CEST}}
produces
- 1
*{{Daylight saving in time zone|PT}}
produces
- 1
*{{Daylight saving in time zone|ACT}}
produces
- 0
*{{Daylight saving in time zone|NZT}}
produces
- 0
*{{Daylight saving in time zone|ET|10 March 2018 10:00 EST}}
produces
- 1
*{{Daylight saving in time zone|ET|11 March 2018 4:50 EST}}
produces
- 1
*{{Daylight saving in time zone|ET|11 March 2018 4:50}}
produces
- 1
Related templates
Current time
Current offset
Daylight savings
- {{Daylight saving active}} (0 when false, 1 when true)
| The above documentation is transcluded from Template:Daylight saving active/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages. Please add categories to the /doc subpage. Subpages of this template. |