Welcome to Dream.In.Code
Become a C++ Expert!

Join 137,262 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,497 people online right now. Registration is fast and FREE... Join Now!




To get time zone between GMT & new york

 
Reply to this topicStart new topic

To get time zone between GMT & new york

jobra
10 Dec, 2006 - 03:40 PM
Post #1

New D.I.C Head
*

Joined: 10 Dec, 2006
Posts: 3


My Contributions
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

CODE

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;
cout << gmtoffset;


But I am not able to New York local time. Thanks a lot in advance.

This post has been edited by Dark_Nexus: 10 Dec, 2006 - 05:48 PM
User is offlineProfile CardPM
+Quote Post

eXceed69
RE: To Get Time Zone Between GMT & New York
12 Dec, 2006 - 06:33 PM
Post #2

"Super Sentai Knight Of DawN"
Group Icon

Joined: 12 Nov, 2006
Posts: 682



Thanked: 1 times
Dream Kudos: 675
My Contributions
You should consider actual time interval on your objective or your aim on this programs.
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/4/08 07:15PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month