summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-02 01:51:41 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-02 01:51:41 +0000
commit7247d1a857934dbaff64efd16fea9a13d0e76525 (patch)
tree42c538079ef1fac3ff545a7ca3077d1a7d82aaf8 /win32
parent2ede3bfee8d17ea8585179e5dcd121114ecc41bd (diff)
* win32/win32.c (gettimeofday): easier calculation. use the definition
of the Gregorian calender. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 4239a4a3fc..2422e0529e 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;