From 05e8ac2ccf54dbbd3478d03646e615398b09119e Mon Sep 17 00:00:00 2001 From: usa Date: Tue, 2 Sep 2008 01:51:41 +0000 Subject: * win32/win32.c (gettimeofday): easier calculation. use the definition of the Gregorian calender. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- win32/win32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'win32') diff --git a/win32/win32.c b/win32/win32.c index 4239a4a3f..2422e0529 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -3102,7 +3102,7 @@ gettimeofday(struct timeval *tv, struct timezone *tz) the first leap second is at 1972/06/30, so we doesn't need to think about it. */ lt /= 10000; /* to msec */ - lt -= (LONG_LONG)(369 * 365 + 24 * 3 + 17) * 24 * 60 * 60 * 1000; + lt -= (LONG_LONG)((1970-1601)*365.2425) * 24 * 60 * 60 * 1000; tv->tv_sec = lt / 1000; tv->tv_usec = lt % 1000; -- cgit