Jacek Caban (@jacek) commented about dlls/jscript/date.c:
static double date_now(void) { FILETIME ftime;
- LONGLONG time;
ULONGLONG time;
GetSystemTimeAsFileTime(&ftime);
- time = ((LONGLONG)ftime.dwHighDateTime << 32) + ftime.dwLowDateTime;
- time = ((ULONGLONG)ftime.dwHighDateTime << 32) + ftime.dwLowDateTime;
- return time/10000 - TIME_EPOCH;
- return (LONGLONG)(time/10000) - (LONGLONG)TIME_EPOCH;
Date constructor uses the same code, so maybe another helper would be useful. Also, you could also just make TIME_EPOCH signed.