 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Mon Oct 01, 2007 7:31 pm Post subject: SYSTEMTIME issues |
|
|
| Code: | LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) {
HWND text;
SYSTEMTIME time;
char buffer[33], buffer2[33];
switch(Message) {
case WM_CREATE:
SetTimer(hwnd, IDI_TIMER, 1000, (TIMERPROC) NULL); //create timer
text = CreateWindowEx(0,
"STATIC", "",
WS_CHILD|WS_VISIBLE, 0,0,100,20,
hwnd,(HMENU)IDI_STATIC,NULL,0); //create static text
break;
case WM_TIMER:
KillTimer(hwnd, IDI_TIMER);
GetSystemTime(&time);
wsprintf(buffer2, "%d%s%d%s%d%s%d%s%d%s%d%s%d%s%d", time.wYear,":", time.wMonth,":", time.wDayOfWeek,":", time.wDay
,":",time.wHour,":", time.wMinute,":", time.wSecond,":", time.wMilliseconds);
wsprintf(buffer, "%d", time.wHour);
MessageBox(hwnd, buffer2, "asfd", 0);
// SetDlgItemText(hwnd, IDI_STATIC, &buffer);
break;
case WM_CLOSE:
DestroyWindow(hwnd);
break;
case WM_DESTROY:
KillTimer(hwnd, IDI_TIMER);
PostQuitMessage(0);
break;
|
when i run the program the year is the only thing correct
if i change the date to september 30, the month is still 10. not 9
the hour should be 18 for me right now (9 pm) but its 1
the minutes and down are correct
its just being weird
full source and exe attached
_________________
|
|
| Back to top |
|
 |
sponge I'm a spammer
Reputation: 1
Joined: 07 Nov 2006 Posts: 6009
|
Posted: Mon Oct 01, 2007 7:54 pm Post subject: |
|
|
GetLocalTime
_________________
Last edited by sponge on Mon Oct 01, 2007 7:54 pm; edited 1 time in total |
|
| Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Mon Oct 01, 2007 7:54 pm Post subject: |
|
|
| Its returing the date and time in GMT.
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Tue Oct 02, 2007 4:10 am Post subject: |
|
|
| Flyte wrote: | | Its returing the date and time in GMT. |
GetSystemTime returns the current time in UTC. As sponge said, you want GetLocalTime to get the fixed time of your system:
| Code: | int main()
{
SYSTEMTIME time;
GetLocalTime( &time );
printf( "%02d:%02d:%02d\n", time.wHour, time.wMinute, time.wSecond );
return 0;
} |
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|