diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-05-15 00:57:49 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-05-15 00:57:49 +0000 |
commit | 00be1c385b77c1fbde45d8f26dc036f53e0c3f67 (patch) | |
tree | f44865ddadd87c26436e222adb2aa3a5d422f21c /win32 | |
parent | e92141c641a20aae4aa53cff3716c8ad8ec0647a (diff) | |
download | ruby-00be1c385b77c1fbde45d8f26dc036f53e0c3f67.tar.gz ruby-00be1c385b77c1fbde45d8f26dc036f53e0c3f67.tar.xz ruby-00be1c385b77c1fbde45d8f26dc036f53e0c3f67.zip |
* win32/win32.c (unixtime_to_filetime): deal with DST.
[ruby-talk:141817]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@8459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r-- | win32/win32.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/win32/win32.c b/win32/win32.c index aa3e94a83..cb16d3024 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -3490,6 +3490,7 @@ unixtime_to_filetime(time_t time, FILETIME *ft) { struct tm *tm; SYSTEMTIME st; + FILETIME lt; tm = gmtime(&time); st.wYear = tm->tm_year + 1900; @@ -3500,7 +3501,8 @@ unixtime_to_filetime(time_t time, FILETIME *ft) st.wMinute = tm->tm_min; st.wSecond = tm->tm_sec; st.wMilliseconds = 0; - if (!SystemTimeToFileTime(&st, ft)) { + if (!SystemTimeToFileTime(&st, <) || + !LocalFileTimeToFileTime(<, ft)) { errno = map_errno(GetLastError()); return -1; } |