18 #ifndef GEOS_TIMEVAL_H
19 #define GEOS_TIMEVAL_H
21 #ifndef WIN32_LEAN_AND_MEAN
22 #define WIN32_LEAN_AND_MEAN
28 #if defined(_MSC_VER) || defined(__BORLANDC__)
29 #define EPOCHFILETIME (116444736000000000i64)
31 #define EPOCHFILETIME (116444736000000000LL)
40 #if !defined(_WIN32_WCE)
42 __inline
int gettimeofday(
struct timeval *tv,
struct timezone *tz)
51 GetSystemTimeAsFileTime(&ft);
52 li.LowPart = ft.dwLowDateTime;
53 li.HighPart = ft.dwHighDateTime;
57 tv->tv_sec = (long)(t / 1000000);
58 tv->tv_usec = (long)(t % 1000000);
68 tz->tz_minuteswest = _timezone / 60;
69 tz->tz_dsttime = _daylight;
77 __inline
int gettimeofday(
struct timeval *tv,
struct timezone *tz)
82 TIME_ZONE_INFORMATION tzi;
89 SystemTimeToFileTime(&st, &ft);
90 li.LowPart = ft.dwLowDateTime;
91 li.HighPart = ft.dwHighDateTime;
95 tv->tv_sec = (long)(t / 1000000);
96 tv->tv_usec = (long)(t % 1000000);
101 GetTimeZoneInformation(&tzi);
103 tz->tz_minuteswest = tzi.Bias;
104 if (tzi.StandardDate.wMonth != 0)
106 tz->tz_minuteswest += tzi.StandardBias * 60;
109 if (tzi.DaylightDate.wMonth != 0)