summaryrefslogtreecommitdiffstats
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
commit05e8ac2ccf54dbbd3478d03646e615398b09119e (patch)
tree42c538079ef1fac3ff545a7ca3077d1a7d82aaf8
parent6eeb8c0d26bd509b0be5d896e3bfd30d03fb4df0 (diff)
downloadruby-05e8ac2ccf54dbbd3478d03646e615398b09119e.tar.gz
ruby-05e8ac2ccf54dbbd3478d03646e615398b09119e.tar.xz
ruby-05e8ac2ccf54dbbd3478d03646e615398b09119e.zip
* 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
-rw-r--r--ChangeLog5
-rw-r--r--win32/win32.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 177e48f59..2a8925e65 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Sep 2 10:49:18 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (gettimeofday): easier calculation. use the definition
+ of the Gregorian calender.
+
Tue Sep 2 10:33:12 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
* common.mk (distclean-golf): moved golf_prelude.c here from
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;