mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* win32/win32.c (unixtime_to_filetime): deal with DST.
[ruby-talk:141817] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a7c5e6bcec
commit
c23d3e4640
2 changed files with 8 additions and 1 deletions
|
@ -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>
|
Sat May 14 23:59:11 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* error.c (exc_exception, {exit,name_err,syserr}_initialize): call
|
* error.c (exc_exception, {exit,name_err,syserr}_initialize): call
|
||||||
|
|
|
@ -3490,6 +3490,7 @@ unixtime_to_filetime(time_t time, FILETIME *ft)
|
||||||
{
|
{
|
||||||
struct tm *tm;
|
struct tm *tm;
|
||||||
SYSTEMTIME st;
|
SYSTEMTIME st;
|
||||||
|
FILETIME lt;
|
||||||
|
|
||||||
tm = gmtime(&time);
|
tm = gmtime(&time);
|
||||||
st.wYear = tm->tm_year + 1900;
|
st.wYear = tm->tm_year + 1900;
|
||||||
|
@ -3500,7 +3501,8 @@ unixtime_to_filetime(time_t time, FILETIME *ft)
|
||||||
st.wMinute = tm->tm_min;
|
st.wMinute = tm->tm_min;
|
||||||
st.wSecond = tm->tm_sec;
|
st.wSecond = tm->tm_sec;
|
||||||
st.wMilliseconds = 0;
|
st.wMilliseconds = 0;
|
||||||
if (!SystemTimeToFileTime(&st, ft)) {
|
if (!SystemTimeToFileTime(&st, <) ||
|
||||||
|
!LocalFileTimeToFileTime(<, ft)) {
|
||||||
errno = map_errno(GetLastError());
|
errno = map_errno(GetLastError());
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue