Difference between revisions of "Template:Daylight saving active/sandbox"

From blackwiki
Jump to navigation Jump to search
imported>Thayts
imported>Gonnym
m (Gonnym moved page Template:Daylight saving in time zone/sandbox to Template:Daylight saving active/sandbox: matching parent's article move)
 
(3 intermediate revisions by one other user not shown)
Line 3: Line 3:
  
 
  * Add a pipe (|) chain with all the abbreviations of the time zones
 
  * 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
+
   for which the same logic is used to calculate the dates at which
 
   DST begins and ends, including both the standard time abbreviation(s)
 
   DST begins and ends, including both the standard time abbreviation(s)
 
   and daylight saving time abbreviation for each time zone, ending the
 
   and daylight saving time abbreviation for each time zone, ending the
   chain with an equal sign (=) followed by the formula.
+
   chain with an equal sign (=) followed by the logic.
  
 
  * Update the documentation.
 
  * Update the documentation.
Line 12: Line 12:
 
  * Also update the technical documentation, found at /techdoc, to
 
  * Also update the technical documentation, found at /techdoc, to
 
   describe at what date and time DST begins and ends as implemented
 
   describe at what date and time DST begins and ends as implemented
   by the formula.
+
   by the logic.
  
 
-->{{#switch:{{uc:{{{1|}}}}}
 
-->{{#switch:{{uc:{{{1|}}}}}
Line 65: Line 65:
 
<!--Australian Central Time-->
 
<!--Australian Central Time-->
 
|ACT|ACST|ACDT
 
|ACT|ACST|ACDT
 
 
<!--Australian Eastern Time-->
 
<!--Australian Eastern Time-->
 
|AET|AEST|AEDT=
 
|AET|AEST|AEDT=
 
  {{#expr:
 
  {{#expr:
 
   {{#time:YmdHi|{{{2|}}}}} <
 
   {{#time:YmdHi|{{{2|}}}}} <
   {{#time:YmdHi|{{#time:Y|{{{2|}}}}}0407-{{#time:w|{{#time:Y|{{{2|}}}}}0407}}days-{{#switch:{{uc:{{{1}}}}}|ACT|ACST|ACDT=7.5|AET|AEST|AEDT=8}}hours}} or
+
   {{#time:YmdHi|{{#time:Y|{{{2|}}}}}0407-{{#time:w|{{#time:Y|{{{2|}}}}}0407}}days-{{#switch:{{uc:{{{1}}}}}|ACT|ACST|ACDT=7|AET|AEST|AEDT=8}}hours-{{#switch:{{uc:{{{1}}}}}|ACT|ACST|ACDT=30|AET|AEST|AEDT=0}}minutes}} or
   {{#time:YmdHi|{{#time:Y|{{{2|}}}}}1007-{{#time:w|{{#time:Y|{{{2|}}}}}1007}}days-{{#switch:{{uc:{{{1}}}}}|ACT|ACST|ACDT=7.5|AET|AEST|AEDT=8}}hours}} <=
+
   {{#time:YmdHi|{{#time:Y|{{{2|}}}}}1007-{{#time:w|{{#time:Y|{{{2|}}}}}1007}}days-{{#switch:{{uc:{{{1}}}}}|ACT|ACST|ACDT=7|AET|AEST|AEDT=8}}hours-{{#switch:{{uc:{{{1}}}}}|ACT|ACST|ACDT=30|AET|AEST|AEDT=0}}minutes}} <=
 
   {{#time:YmdHi|{{{2|}}}}}
 
   {{#time:YmdHi|{{{2|}}}}}
 
  }}
 
  }}
Line 83: Line 82:
 
<!--New Zealand Time-->
 
<!--New Zealand Time-->
 
|NZT|NZST|NZDT=
 
|NZT|NZST|NZDT=
  {{#ifexpr:
+
  {{#expr:
      <!--October through March-->
+
  {{#time:YmdH|{{{2|}}}}} <
          ({{#time:n|12 hours}} > 9 or  {{#time:n|12 hours}} < 4)
+
  {{#time:YmdH|{{#time:Y|{{{2|}}}}}0407-{{#time:w|{{#time:Y|{{{2|}}}}}0407}}days-10hours}} or
      <!--date in September after start DST-->
+
  {{#time:YmdH|{{#time:Y|{{{2|}}}}}0930-{{#time:w|{{#time:Y|{{{2|}}}}}0930}}days-10hours}} <=
        or ({{#time:n|12 hours}} = 9 and {{#time:j|12 hours}} > {{#expr:(30 - (5*{{#time:Y}}/4 + 5) mod 7)}})
+
  {{#time:YmdH|{{{2|}}}}}
      <!--date in April before end DST-->
 
        or ({{#time:n|12 hours}} = 4 and {{#time:j|12 hours}} < {{#expr:(7  - (5*{{#time:Y}}/4 + 4) mod 7)}})
 
      <!--day of start DST after 2 AM local standard time (last Sunday in September)-->
 
        or ({{#time:n|12 hours}} = 9 and {{#time:j|12 hours}} = {{#expr:(30 - (5*{{#time:Y}}/4 + 5) mod 7)}} and {{#time:G|12 hours}} >= 2)
 
      <!--day of end DST before 3 AM local daylight saving time, or 2 AM local standard time (first Sunday in April)-->
 
        or ({{#time:n|12 hours}} = 4 and {{#time:j|12 hours}} = {{#expr:(7  - (5*{{#time:Y}}/4 + 4) mod 7)}} and {{#time:G|12 hours}} < 2)
 
  |1 <!--DST active-->
 
  |0 <!--DST not active-->
 
 
  }}
 
  }}
  

Latest revision as of 09:34, 10 March 2019

0