Solved

Local tim to GMT

Posted on 1999-01-29
2
219 Views
Last Modified: 2010-04-15
Hi,
I would like to know what is the formula to convert local time to GMT with daylight saving.
thanks in advance
0
Comment
Question by:pchaloux
2 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 1258535
#include <time.h>
struct tm local[1]={
0,
20,
15,
29,
1-1,
1999-1900,
5,
28,
-1
};
time_t clock;
clock = mktime(local);
printf("%s\n",asctime(gmtime(&clock)));
0
 
LVL 2

Accepted Solution

by:
amitc011599 earned 100 total points
ID: 1258536
Depends on the format the straight way is to use the standard CRT method, localtime() from time.h.

Incase you need the formula, get the VC++ 5.0 CD, look in the file LOCALTIM.C.
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question