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
I need advice on the Daylight Savings facility in NB library
- Chris Ruff
- Posts: 222
- Joined: Thu Apr 24, 2008 4:09 pm
- Location: topsail island, nc
- Contact:
I need advice on the Daylight Savings facility in NB library
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand
-
- Posts: 1
- Joined: Wed Oct 19, 2011 8:22 am
Re: I need advice on the Daylight Savings facility in NB lib
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?
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?