Click here to Skip to main content
15,892,537 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Ignored inline keyword Pin
Stephen Hewitt30-Mar-06 18:14
Stephen Hewitt30-Mar-06 18:14 
GeneralRe: Ignored inline keyword Pin
Arvind Bharti30-Mar-06 19:23
Arvind Bharti30-Mar-06 19:23 
GeneralRe: Ignored inline keyword Pin
Ryan Binns30-Mar-06 18:05
Ryan Binns30-Mar-06 18:05 
AnswerRe: Ignored inline keyword Pin
Ryan Binns30-Mar-06 18:07
Ryan Binns30-Mar-06 18:07 
GeneralRe: Ignored inline keyword Pin
Stephen Hewitt30-Mar-06 18:20
Stephen Hewitt30-Mar-06 18:20 
GeneralRe: Ignored inline keyword Pin
Arvind Bharti30-Mar-06 19:20
Arvind Bharti30-Mar-06 19:20 
GeneralRe: Ignored inline keyword Pin
Ryan Binns30-Mar-06 21:56
Ryan Binns30-Mar-06 21:56 
QuestionUTC time Clock and Local time Clock? Pin
Yonggoo30-Mar-06 13:38
Yonggoo30-Mar-06 13:38 
Hi,

I am making a program to print out both UTC time and local time.
But, I am having the same time.
Do I have to save UTC time before 'ptrLocalTime = localtime(&localtimer);'?


/* This program shows UTC time, and local time in 00:00:00 */
#include <stdio.h>
#include <time.h>

#define PST (-8) //Pacific Time Zone
#define CST (-6) //Central Time Zone

int main ()
{
time_t timer;
time_t localtimer;
tm* ptrUTC;
tm* ptrLocalTime;

time ( &timer ); //Set timer to the number of seconds elapsed since 00:00 hours,
//Jan 1, 1970 UTC from the system clock.
time(&localtimer);
ptrUTC = gmtime ( &timer ); //Converts timer to tm structure adjusting to UTC
//(formerly known as GMT) timezone.
ptrLocalTime = localtime(&localtimer);

printf ("UTC Time: %2d:%02d:%02d\n", ptrUTC->tm_hour, ptrUTC->tm_min, ptrUTC->tm_sec);
printf ("Locat time : %2d:%02d:%02d\n", ptrLocalTime->tm_hour, ptrLocalTime->tm_min, ptrLocalTime->tm_sec);


return 0;
}


Please!


Yonggoo
AnswerRe: UTC time Clock and Local time Clock? Pin
Arvind Bharti30-Mar-06 15:17
Arvind Bharti30-Mar-06 15:17 
QuestionRegistry export/merge Pin
sschilachi30-Mar-06 13:24
sschilachi30-Mar-06 13:24 
AnswerRe: Registry export/merge Pin
David Crow30-Mar-06 16:00
David Crow30-Mar-06 16:00 
AnswerRe: Registry export/merge Pin
Ștefan-Mihai MOGA31-Mar-06 1:28
professionalȘtefan-Mihai MOGA31-Mar-06 1:28 
QuestionHow to retrieve a description of network adapters? Pin
Allad30-Mar-06 12:45
Allad30-Mar-06 12:45 
QuestionHow to resolve Error:2039 Pin
celllllllll30-Mar-06 12:28
celllllllll30-Mar-06 12:28 
AnswerRe: How to resolve Error:2039 Pin
celllllllll30-Mar-06 12:31
celllllllll30-Mar-06 12:31 
QuestionHow to launch Winamp? Pin
Allad30-Mar-06 12:10
Allad30-Mar-06 12:10 
AnswerRe: How to launch Winamp? Pin
Michael Dunn30-Mar-06 13:01
sitebuilderMichael Dunn30-Mar-06 13:01 
GeneralRe: How to launch Winamp? Pin
Allad30-Mar-06 13:12
Allad30-Mar-06 13:12 
AnswerRe: How to launch Winamp? Pin
Stephen Hewitt30-Mar-06 14:20
Stephen Hewitt30-Mar-06 14:20 
GeneralRe: How to launch Winamp? Pin
Allad31-Mar-06 6:57
Allad31-Mar-06 6:57 
GeneralRe: How to launch Winamp? Pin
Stephen Hewitt31-Mar-06 17:36
Stephen Hewitt31-Mar-06 17:36 
QuestionCan not add new controls to class? Pin
ns30-Mar-06 10:35
ns30-Mar-06 10:35 
AnswerRe: Can not add new controls to class? Pin
David Crow30-Mar-06 10:58
David Crow30-Mar-06 10:58 
QuestionSending A Variable to another computer. Pin
dSolariuM30-Mar-06 10:10
dSolariuM30-Mar-06 10:10 
AnswerRe: Sending A Variable to another computer. Pin
David Crow30-Mar-06 10:56
David Crow30-Mar-06 10:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.