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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

confusing DAY LIGHT SAVINGS

Status
Not open for further replies.

logic4fun

Programmer
Apr 24, 2003
85
US
Hi all ,
i have a question with the daylight saving

for 2002-10-27-01.15.15 timestamp

I will have two unix times becoz of daylight savings.

i.e.
1035699315
1035695715

and both the above unix times when u do VTIME they give same time stamp

I would like to set the timezone in my function or someway to standardize the time. can somebody help me out.

thanks
logic4fun

 
Here's a small example of changing the timezone within a program.
Code:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main ( ) {
    time_t  now = time(NULL);
    printf( &quot;%s&quot;, ctime(&now) );
    putenv(&quot;TZ=GMT&quot;);
    printf( &quot;%s&quot;, ctime(&now) );
    return 0;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top