2 * Win32 kernel functions
4 * Copyright 1995 Martin von Loewis and Cameron Heide
13 #include "debugtools.h"
15 DEFAULT_DEBUG_CHANNEL(win32
);
17 /***********************************************************************
18 * GetLocalTime (KERNEL32.@)
20 VOID WINAPI
GetLocalTime(LPSYSTEMTIME systime
)
26 gettimeofday(&tv
, NULL
);
27 local_time
= tv
.tv_sec
;
28 local_tm
= localtime(&local_time
);
30 systime
->wYear
= local_tm
->tm_year
+ 1900;
31 systime
->wMonth
= local_tm
->tm_mon
+ 1;
32 systime
->wDayOfWeek
= local_tm
->tm_wday
;
33 systime
->wDay
= local_tm
->tm_mday
;
34 systime
->wHour
= local_tm
->tm_hour
;
35 systime
->wMinute
= local_tm
->tm_min
;
36 systime
->wSecond
= local_tm
->tm_sec
;
37 systime
->wMilliseconds
= (tv
.tv_usec
/ 1000) % 1000;
40 /***********************************************************************
41 * GetSystemTime (KERNEL32.@)
43 VOID WINAPI
GetSystemTime(LPSYSTEMTIME systime
)
49 gettimeofday(&tv
, NULL
);
50 system_time
= tv
.tv_sec
;
51 system_tm
= gmtime(&system_time
);
53 systime
->wYear
= system_tm
->tm_year
+ 1900;
54 systime
->wMonth
= system_tm
->tm_mon
+ 1;
55 systime
->wDayOfWeek
= system_tm
->tm_wday
;
56 systime
->wDay
= system_tm
->tm_mday
;
57 systime
->wHour
= system_tm
->tm_hour
;
58 systime
->wMinute
= system_tm
->tm_min
;
59 systime
->wSecond
= system_tm
->tm_sec
;
60 systime
->wMilliseconds
= (tv
.tv_usec
/ 1000) % 1000;