* times.cc (to_time_t): Always round time_t down to nearest second.
This commit is contained in:
parent
1ceb2460db
commit
be18721ec4
@ -1,3 +1,7 @@
|
|||||||
|
2002-07-24 David MacMahon <davidm@smartsc.com>
|
||||||
|
|
||||||
|
* times.cc (to_time_t): Always round time_t down to nearest second.
|
||||||
|
|
||||||
2002-07-25 Egor Duda <deo@logos-m.ru>
|
2002-07-25 Egor Duda <deo@logos-m.ru>
|
||||||
|
|
||||||
* Makefile.in: Check if API version is updated when exports are
|
* Makefile.in: Check if API version is updated when exports are
|
||||||
|
@ -212,7 +212,6 @@ to_time_t (FILETIME *ptr)
|
|||||||
stuffed into two long words.
|
stuffed into two long words.
|
||||||
A time_t is the number of seconds since jan 1 1970. */
|
A time_t is the number of seconds since jan 1 1970. */
|
||||||
|
|
||||||
long rem;
|
|
||||||
long long x = ((long long) ptr->dwHighDateTime << 32) + ((unsigned)ptr->dwLowDateTime);
|
long long x = ((long long) ptr->dwHighDateTime << 32) + ((unsigned)ptr->dwLowDateTime);
|
||||||
|
|
||||||
/* pass "no time" as epoch */
|
/* pass "no time" as epoch */
|
||||||
@ -220,10 +219,7 @@ to_time_t (FILETIME *ptr)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
x -= FACTOR; /* number of 100ns between 1601 and 1970 */
|
x -= FACTOR; /* number of 100ns between 1601 and 1970 */
|
||||||
rem = x % ((long long)NSPERSEC);
|
|
||||||
rem += (NSPERSEC / 2);
|
|
||||||
x /= (long long) NSPERSEC; /* number of 100ns in a second */
|
x /= (long long) NSPERSEC; /* number of 100ns in a second */
|
||||||
x += (long long) (rem / NSPERSEC);
|
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user