nobu.nokada
5/15/2005 12:46:00 AM
Hi,
At Mon, 9 May 2005 18:19:34 +0900,
mike wrote in [ruby-talk:141817]:
> H:\devel>c:\ruby1.8\bin\ruby.exe -v test_mtime.rb
> ruby 1.8.2 (2004-12-25) [i386-mswin32]
> 946681200.0
> 946684800.0
>
> The file's mtime is 1 hour later. Using Time.gm doesn't fix the
> problem.
It seems like related to DST.
Index: win32/win32.c
===================================================================
RCS file: /cvs/ruby/src/ruby/win32/win32.c,v
retrieving revision 1.148
diff -U2 -p -r1.148 win32.c
--- win32/win32.c 14 May 2005 14:57:04 -0000 1.148
+++ win32/win32.c 15 May 2005 00:43:06 -0000
@@ -3491,4 +3491,5 @@ unixtime_to_filetime(time_t time, FILETI
struct tm *tm;
SYSTEMTIME st;
+ FILETIME lt;
tm = gmtime(&time);
@@ -3501,5 +3502,6 @@ unixtime_to_filetime(time_t time, FILETI
st.wSecond = tm->tm_sec;
st.wMilliseconds = 0;
- if (!SystemTimeToFileTime(&st, ft)) {
+ if (!SystemTimeToFileTime(&st, <) ||
+ !LocalFileTimeToFileTime(<, ft)) {
errno = map_errno(GetLastError());
return -1;
--
Nobu Nakada