Implement better version of DPA_Merge.
[wine/multimedia.git] / win32 / time.c
blob7dbeba488fe8bb77562fd82b89e7430fb9f69b3c
1 /*
2 * Win32 kernel functions
4 * Copyright 1995 Martin von Loewis and Cameron Heide
5 */
7 #include <string.h>
8 #include <time.h>
9 #include <sys/time.h>
10 #include <unistd.h>
11 #include "file.h"
12 #include "winerror.h"
13 #include "debugtools.h"
15 DEFAULT_DEBUG_CHANNEL(win32);
17 /***********************************************************************
18 * GetLocalTime (KERNEL32.228)
20 VOID WINAPI GetLocalTime(LPSYSTEMTIME systime)
22 time_t local_time;
23 struct tm *local_tm;
24 struct timeval tv;
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.285)
43 VOID WINAPI GetSystemTime(LPSYSTEMTIME systime)
45 time_t local_time;
46 struct tm *local_tm;
47 struct timeval tv;
49 gettimeofday(&tv, NULL);
50 local_time = tv.tv_sec;
51 local_tm = gmtime(&local_time);
53 systime->wYear = local_tm->tm_year + 1900;
54 systime->wMonth = local_tm->tm_mon + 1;
55 systime->wDayOfWeek = local_tm->tm_wday;
56 systime->wDay = local_tm->tm_mday;
57 systime->wHour = local_tm->tm_hour;
58 systime->wMinute = local_tm->tm_min;
59 systime->wSecond = local_tm->tm_sec;
60 systime->wMilliseconds = (tv.tv_usec / 1000) % 1000;