summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-05-15 00:57:49 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-05-15 00:57:49 +0000
commitcc31822f6b518df5c24723d90e2dac227edc6d1b (patch)
treef1c8fed79a19216b7f0660ec6b88f0743846fbcb
parentc8b9e86e3b02434be247f20291b0b8a764afe163 (diff)
downloadruby-cc31822f6b518df5c24723d90e2dac227edc6d1b.tar.gz
ruby-cc31822f6b518df5c24723d90e2dac227edc6d1b.tar.xz
ruby-cc31822f6b518df5c24723d90e2dac227edc6d1b.zip
* win32/win32.c (unixtime_to_filetime): deal with DST.
[ruby-talk:141817] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--win32/win32.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 81e72360d..ab58372e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sun May 15 09:57:30 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (unixtime_to_filetime): deal with DST.
+ [ruby-talk:141817]
+
Sat May 14 23:59:11 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* error.c (exc_exception, {exit,name_err,syserr}_initialize): call
diff --git a/win32/win32.c b/win32/win32.c
index ce194bb40..1beb79d2c 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -3301,6 +3301,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;
@@ -3311,7 +3312,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, &lt) ||
+ !LocalFileTimeToFileTime(&lt, ft)) {
errno = map_errno(GetLastError());
return -1;
}