I have forgotten
my Password

Or login with:

  • Facebookhttp://facebook.com/
  • Googlehttps://www.google.com/accounts/o8/id
  • Yahoohttps://me.yahoo.com
Index » Programming » C/C++ »

Help to get time zone between GMT & new york

dusty\′s Photo
10 Dec 06, 10:32PM
(1 reply)
Help to get time zone between GMT & new york
Please can anyone help me to get the time zone between GMT & New York including the daylight saving.

I am able to get the timezone between GMT & localtime including the daylight saving. My program goes like this

time_t t = time(0); struct tm* data; data = localtime(&t); data->tm_isdst = 0; time_t a = mktime(data); data = gmtime(&t); data->tm_isdst = 0; time_t b = mktime(data); int gmtoffset = (a - b)/3600;

But I am not able to New York local time. Thanks a lot in advance.
will\′s Photo
13 Dec 06, 7:28AM
Hey, I think all this work has been done before - and is under a GPL on CodeCogs.

Your code below essentially does the same as this component: http://www.codecogs.com/d-ox/units/time/gmtoffset.php

To figure out Summertime, you need to look at the dates. There are several different formulas used around the world to decide when summer time starts/ends. Look at http://www.codecogs.com/d-ox/units/time/summertime.php

The offset between any main location are given in: http://www.codecogs.com/d-ox/units/time/worldtimediff.php

What else did you need?

Will.

Currently you need to be logged in to leave a message.