ruby-changes:7532
From: usa <ko1@a...>
Date: Tue, 2 Sep 2008 10:52:02 +0900 (JST)
Subject: [ruby-changes:7532] Ruby:r19053 (trunk): * win32/win32.c (gettimeofday): easier calculation. use the definition
usa 2008-09-02 10:51:41 +0900 (Tue, 02 Sep 2008) New Revision: 19053 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=19053 Log: * win32/win32.c (gettimeofday): easier calculation. use the definition of the Gregorian calender. Modified files: trunk/ChangeLog trunk/win32/win32.c Index: ChangeLog =================================================================== --- ChangeLog (revision 19052) +++ ChangeLog (revision 19053) @@ -1,3 +1,8 @@ +Tue Sep 2 10:49:18 2008 NAKAMURA Usaku <usa@r...> + + * win32/win32.c (gettimeofday): easier calculation. use the definition + of the Gregorian calender. + Tue Sep 2 10:33:12 2008 Yuki Sonoda (Yugui) <yugui@y...> * common.mk (distclean-golf): moved golf_prelude.c here from Index: win32/win32.c =================================================================== --- win32/win32.c (revision 19052) +++ win32/win32.c (revision 19053) @@ -3102,7 +3102,7 @@ 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; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/