Difference between revisions of "Template:Isusdst"

From Geohashing
imported>Tjtrumpet2323
m
imported>Tjtrumpet2323
(Undo revision 31250 by Tjtrumpet2323 (Talk))
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#switch: {{ #time: m | {{CURRENTTIMESTAMP}} }}
+
#REDIRECT [[Template:usdst]]
| 1 = 0
 
| 2 = 0
 
| 3 = {{ #ifexpr: 15 - {{ #time: N | {{CURRENTYEAR}}-{{CURRENTMONTH}}-01 }} > {{ #time: d | {{CURRENTTIMESTAMP}} }}
 
  | 1 <!-- already happened -->
 
  | {{ #ifexpr: 15 - {{ #time: N | {{CURRENTYEAR}}-{{CURRENTMONTH}}-01 }} = {{ #time: d | {{CURRENTTIMESTAMP}} and {{ #time: Hi | {{CURRENTTIMESTAMP}} }} >= 0700 }}
 
  | 1 <!-- the very day -->
 
  | 0 <!-- not yet --> }} }}
 
| 4 = 1
 
| 5 = 1
 
| 6 = 1
 
| 7 = 1
 
| 8 = 1
 
| 9 = 1
 
| 10 = 1
 
| 11 = {{ #ifexpr: 8 - {{ #time: N | {{CURRENTYEAR}}-{{CURRENTMONTH}}-01 }} > {{ #time: d | {{CURRENTTIMESTAMP}} }}
 
  | 0 <!-- already happened -->
 
  | {{ #ifexpr: 8 - {{ #time: N | {{CURRENTYEAR}}-{{CURRENTMONTH}}-01 }} = {{ #time: d | {{CURRENTTIMESTAMP}} and {{ #time: Hi | {{CURRENTTIMESTAMP}} }} >= 0600 }}
 
  | 0 <!-- the very day -->
 
  | 1 <!-- not yet --> }} }}
 
| 12 = 0
 
| #default = 0
 
}}<noinclude>
 
== Usage ==
 
<code><nowiki>{{isusdst}}</nowiki></code>
 
* Returns '''1''' if the United States (specifically its [[Eastern Time|Eastern Time Zone]] are in [[wikipedia:Daylight Saving Time|Daylight Saving Time]], '''0''' if not.
 
** From 2007, Daylight Saving Time is observed in the United States from 02:00 (local) on the second Sunday in March through 02:00 (local) on the first Sunday in November.
 
** This template only returns the DST value for the current timestamp, and thus only is programmed to handle post-2007 DST rules.
 
</noinclude>
 

Latest revision as of 05:51, 3 July 2008

Redirect to: