Solved

Local tim to GMT

Posted on 1999-01-29
2
210 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
Comment Utility
#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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
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 how to use strings and some functions related to them in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now