Take time into account in wxDateTime <-> SYSTEMTIME conversion.
wxDateTime::SetFromMSWSysTime() and GetAsMSWSysTime() worked with the date part of SYSTEMTIME only, do use time part as well now. Closes #11176. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61842 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -412,6 +412,7 @@ MSW:
|
|||||||
- Fix wxMDIChildFrame::SetSize() (Lars Rosenboom).
|
- Fix wxMDIChildFrame::SetSize() (Lars Rosenboom).
|
||||||
- Fix wxTreeCtrl::UnselectItem() in single selection controls.
|
- Fix wxTreeCtrl::UnselectItem() in single selection controls.
|
||||||
- Allow customizing wxStandardPaths logic for program directory determination.
|
- Allow customizing wxStandardPaths logic for program directory determination.
|
||||||
|
- Use time in wxDateTime <-> SYSTEMTIME conversion (troelsk).
|
||||||
|
|
||||||
i18n:
|
i18n:
|
||||||
|
|
||||||
|
@@ -2356,7 +2356,7 @@ wxDateTime& wxDateTime::SetFromMSWSysTime(const SYSTEMTIME& st)
|
|||||||
return Set(st.wDay,
|
return Set(st.wDay,
|
||||||
static_cast<wxDateTime::Month>(wxDateTime::Jan + st.wMonth - 1),
|
static_cast<wxDateTime::Month>(wxDateTime::Jan + st.wMonth - 1),
|
||||||
st.wYear,
|
st.wYear,
|
||||||
0, 0, 0);
|
st.wHour, st.wMinute, st.wSecond, st.wMilliseconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDateTime::GetAsMSWSysTime(SYSTEMTIME* st) const
|
void wxDateTime::GetAsMSWSysTime(SYSTEMTIME* st) const
|
||||||
@@ -2367,11 +2367,11 @@ void wxDateTime::GetAsMSWSysTime(SYSTEMTIME* st) const
|
|||||||
st->wMonth = (WXWORD)(tm.mon - wxDateTime::Jan + 1);
|
st->wMonth = (WXWORD)(tm.mon - wxDateTime::Jan + 1);
|
||||||
st->wDay = tm.mday;
|
st->wDay = tm.mday;
|
||||||
|
|
||||||
st->wDayOfWeek =
|
st->wDayOfWeek = 0;
|
||||||
st->wHour =
|
st->wHour = tm.hour;
|
||||||
st->wMinute =
|
st->wMinute = tm.min;
|
||||||
st->wSecond =
|
st->wSecond = tm.sec;
|
||||||
st->wMilliseconds = 0;
|
st->wMilliseconds = tm.msec;
|
||||||
}
|
}
|
||||||
#endif // __WXMSW__
|
#endif // __WXMSW__
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user