Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calculating daylight savings dates

Status
Not open for further replies.

trueproblem

Programmer
Nov 18, 2003
2
US
Hi, I'm trying to figure out how to calculate what the dates of the time change are. I am using Java and need to return the date in April and October when the time will change each year. Can anyone help me out?
 
Go to:

This explains about Daylight Saving Time (we call it British Summer Time) in the UK and Europe and has links for other parts of the world.

Note that it's not a simple caculation and will involve knowing the location where the calculation is carried out (if the code is to be used internationally).

________________________________________
[hippy]Roger J Coult; Grimsby, UK
In the game of life the dice have an odd number of sides.
 
You should retreive the values of the global variables
named _daylight, _timezone, _tzname[0], _tzname[1] set for your machine and next calculate the dates depending on these values.
Example:
printf( "_daylight is %d\n", _daylight); // 1 if DST was specfied in TZ else 0
printf( "_timezone is %ld\n", _timezone); // difference in sec between UTC and local time set on this machine
printf( "_tzname[0] is %s\n", _tzname[0]); // location set for this machine
printf( "_tzname[1] is %s\n", _tzname[1]);
-obislavu-





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top