|
-
April 6th, 1999, 07:46 PM
#1
Daylight Savings Time
Is there a way to tell if daylight savings time is active. I need to check for daylight savings time and my program needs to perform two different functions depending whether the time zone is currently in DST or not
Thanks
-
April 7th, 1999, 01:02 AM
#2
Re: Daylight Savings Time
Hi,
to check if daylight saving is in effect you do this:
for the current time
====================
setlocale( LC_ALL, "" ); // don't forget to set the locale
if( CTime::GetCurrentTime( ).GetLocalTm( )->tm_isdst == 0 )
{
TRACE0( "daylight saving is not in effect\n" );
}
else
{
TRACE0( "daylight saving is in effect\n" );
}
for any time
============
setlocale( LC_ALL, "" ); // don't forget to set the locale
if( CTime( 1999, 4, 7, 8, 53, 0, -1 ).GetLocalTm( )->tm_isdst == 0 )
{
TRACE0( "daylight saving is not in effect\n" );
}
else
{
TRACE0( "daylight saving is in effect\n" );
}
HTH
Holger
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|