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 > Re: Daylight Sa...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 1429 of 1466
Post > Topic >>

Re: Daylight Saving Time

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

-> Here in Europe, it is from the last sunday in march to the last sunday 
-> in october. 
  
OK. Here's a version of the program for Europeans. 
  
----------------------------------------------------- 
  
' DSTDATE.BAS 
' Calculates start and end dates of Daylight Saving Time 
' David Williams, 2002 
' Modified for European rules (last Sundays of March and Oct) 
' This version March 2008. 
  
DEFINT A-Z 
CLS 
INPUT "Year"; Y 
Q = Y + Y \ 4 - Y \ 100 + Y \ 400 
F = 31 - (Q + 5) MOD 7 
B = 31 - (Q + 2) MOD 7 
PRINT "In the year"; STR$(Y); ", clocks are set ahead on" 
PRINT "March"; STR$(F); ", and back on October"; STR$(B); "." 
PRINT "Both dates are Sundays." 
END 
  
------------------------------------------------------ 
  
It's slightly more complex than the North American version. In any 
year, March and November, the months when North American clocks are 
changed, start on the same day of the week. This allows most of the 
calculation to be done only once. This accidental simplification 
doesn't happen in this European version. 
  
                           dow




 1 Posts in Topic:
Re: Daylight Saving Time
david.williams@[EMAIL PRO  2008-03-01 09:54:01 

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 5:48:25 CDT 2008.