Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Basic Misc > Daylight Saving...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 1428 of 1466
Post > Topic >>

Daylight Saving Time

by david.williams@[EMAIL PROTECTED] (David Williams) Mar 1, 2008 at 12:20 AM

In most of North America, Daylight Saving Time is in effect from the 
second Sunday in March until the first Sunday in November. The 
following few lines of BASIC calculate these dates for any year, from 
2007 onward. Prior to 2007, different rules were in effect. 
  
-------------------------------------------- 
  
' DSTDATE.BAS 
' Calculates start and end dates of Daylight Saving Time 
' David Williams, 2002 
' Modified for new DST rules, 2006 
  
DEFINT A-Z 
CLS 
INPUT "Year"; Y 
IF Y < 2007 THEN BEEP: PRINT "Not valid before 2007": END 
B = 7 - (2 + Y + Y \ 4 - Y \ 100 + Y \ 400) MOD 7 
PRINT "In most of North America, in the year"; STR$(Y); 
PRINT ", clocks are set ahead on March"; STR$(7 + B); "," 
PRINT "and back on November"; STR$(B); 
PRINT ". Both dates are Sundays." 
END 
  
------------------------------------------------------------ 
  
Note that there are a few places in North America, such as the Canadian 
province of Saskatchewan, where Daylight Saving Time is not used. 
Clocks there show Standard Time year-round. Also, other parts of the 
world have different rules, so clocks there are changed on different 
dates. 
  
Nowadays, North American clocks "spring ahead" in wintertime! 
  
                           dow




 3 Posts in Topic:
Daylight Saving Time
david.williams@[EMAIL PRO  2008-03-01 00:20:14 
Re: Daylight Saving Time
Bernardo Rossi <b.ross  2008-03-01 08:13:59 
Re: Daylight Saving Time
invalid@[EMAIL PROTECTED]  2008-03-06 21:31:10 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue May 13 16:54:49 CDT 2008.