summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-02 01:52:46 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-02 01:52:46 +0000
commit61ae1c9800827611288b522faa99bbc415009ccd (patch)
tree37aa77dd9590884f6de502827e6353ca6b0ee543
parent5a445ae808c489d7a15bc9d1bee8c1df1911175a (diff)
* win32/win32.c (gettimeofday): easier calculation. use the definition
of the Gregorian calender. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@19054 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 ae21e306f4..e0090233a7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Sep 2 10:52:34 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (gettimeofday): easier calculation. use the definition
+ of the Gregorian calender.
+
Tue Sep 2 10:18:58 2008 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (gettimeofday): calc tv_sec and tv_usec from system
diff --git a/win32/win32.c b/win32/win32.c
index 13ddbd374b..c63f211db1 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -2992,7 +2992,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;