Click here to Skip to main content
15,914,014 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CFileDialog problem Pin
Amihai14-May-03 3:49
Amihai14-May-03 3:49 
GeneralRe: CFileDialog problem Pin
Anonymous14-May-03 3:55
Anonymous14-May-03 3:55 
GeneralRe: CFileDialog problem Pin
Anonymous14-May-03 4:11
Anonymous14-May-03 4:11 
Generallength of a vector Pin
flora_k14-May-03 3:29
flora_k14-May-03 3:29 
GeneralRe: length of a vector Pin
Nick Parker14-May-03 3:50
protectorNick Parker14-May-03 3:50 
GeneralRe: length of a vector Pin
Nitron14-May-03 14:34
Nitron14-May-03 14:34 
GeneralRe: length of a vector Pin
Nick Parker15-May-03 18:25
protectorNick Parker15-May-03 18:25 
QuestionCan not get current time. Pin
George214-May-03 2:24
George214-May-03 2:24 
Hi, everyone!

When using the following piece of codes to get the hour value of
the day, I find the value I can get is always 8 hours lower than current time.

I do not know why. Can anyone help?

--------
#include <iostream>
#include <time.h>

using namespace std;

int main()
{
time_t curr_time;
time (&curr_time);
struct tm *curr_tm=gmtime (&curr_time);
cout << curr_tm->tm_hour << endl; //not correct
cout << (curr_tm->tm_hour + 8) % 24 << endl; //not correct
return 1;
}
--------


Thanks in advance,
George
AnswerRe: Can not get current time. Pin
David Crow14-May-03 2:51
David Crow14-May-03 2:51 
GeneralRe: Can not get current time. Pin
George214-May-03 3:04
George214-May-03 3:04 
GeneralRe: Can not get current time. Pin
David Crow14-May-03 3:11
David Crow14-May-03 3:11 
GeneralRe: Can not get current time. Pin
George214-May-03 4:06
George214-May-03 4:06 
AnswerRe: Can not get current time. Pin
jhaga14-May-03 2:54
professionaljhaga14-May-03 2:54 
GeneralRe: Can not get current time. Pin
George214-May-03 3:02
George214-May-03 3:02 
GeneralRe: Can not get current time. Pin
jhaga14-May-03 3:08
professionaljhaga14-May-03 3:08 
GeneralRe: Can not get current time. Pin
George214-May-03 4:03
George214-May-03 4:03 
GeneralRe: Can not get current time. Pin
David Crow14-May-03 4:39
David Crow14-May-03 4:39 
GeneralRe: Can not get current time. Pin
George214-May-03 18:31
George214-May-03 18:31 
GeneralRe: Can not get current time. Pin
David Crow15-May-03 2:43
David Crow15-May-03 2:43 
GeneralRe: Can not get current time. Pin
George215-May-03 18:58
George215-May-03 18:58 
GeneralRe: Can not get current time. Pin
David Crow16-May-03 4:24
David Crow16-May-03 4:24 
GeneralRe: Can not get current time. Pin
George216-May-03 19:00
George216-May-03 19:00 
GeneralUrgent help please!!!!!!!!!!!!!!!!!! Pin
xxhimanshu14-May-03 2:01
xxhimanshu14-May-03 2:01 
GeneralRe: Urgent help please!!!!!!!!!!!!!!!!!! Pin
Franz Klein14-May-03 4:22
Franz Klein14-May-03 4:22 
GeneralRe: Urgent help please!!!!!!!!!!!!!!!!!! Pin
Joan M14-May-03 5:14
professionalJoan M14-May-03 5:14 

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.