Page 1 of 1

I need advice on the Daylight Savings facility in NB library

Posted: Wed Oct 19, 2011 7:40 am
by Chris Ruff
Does anyone on the list know _exactly_ how the daylight savings works?

1.If I set the clock with NTP and then call effs_time::SetTimeZone(-5,true) I get the present time here.
2.If I set the clock with NTP and then call effs_time::SetTimeZone(-5,false) I *still* get the present time here.

When does DST get referenced,applied?
Does DST actually work?

Is there code in the libraries that calculates the 2nd week in March:Sunday AM, the 1st week in November:Sunday AM and applies the summer +1hr if applicable?

Thanks in advance,

Chris

Re: I need advice on the Daylight Savings facility in NB lib

Posted: Wed Oct 19, 2011 8:34 am
by DustedLife
There is a library function called "tzsetchar()" in the NetBurner runtime library PDF document (Chapter 13 - NBTime Library) of the NNDK tools that allows you to set the the local time zone, and daylight savings time, if any.

So I'm assuming in your case with eastern time zone:

tzsetchar( "EST05:00:00EDT04:00:00,M3.2.0/2,M11.1.0/2" );

According to the function description, eastern standard time is set 5 hours behind UTC and eastern daylight time is set 4 hours behind UTC.

"M3.2.0/2" refers to when daylight savings time starts [March (3) on the 2nd (2) Sunday (0)] at 2:00 AM (/2).

"M11.1.0/2" refers to when daylight savings time ends [November (11) on the 1st (1) Sunday (0)] at 2:00 AM (/2).

Is this what you're looking for?