added wxDateTime::SetFrom/GetAsMSWSysTime() (#9161)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53697 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-05-22 00:49:27 +00:00
parent 026d727651
commit 154014d681
6 changed files with 91 additions and 41 deletions

View File

@@ -24,32 +24,8 @@ namespace wxMSWDateControls
// happen with a very old version of common controls DLL, i.e. before 4.70)
extern bool CheckInitialization();
// convert SYSTEMTIME to wxDateTime
inline void FromSystemTime(wxDateTime *dt, const SYSTEMTIME& st)
{
dt->Set(st.wDay,
wx_static_cast(wxDateTime::Month, wxDateTime::Jan + st.wMonth - 1),
st.wYear,
0, 0, 0);
}
// convert wxDateTime to SYSTEMTIME
inline void ToSystemTime(SYSTEMTIME *st, const wxDateTime& dt)
{
const wxDateTime::Tm tm(dt.GetTm());
st->wYear = (WXWORD)tm.year;
st->wMonth = (WXWORD)(tm.mon - wxDateTime::Jan + 1);
st->wDay = tm.mday;
st->wDayOfWeek =
st->wHour =
st->wMinute =
st->wSecond =
st->wMilliseconds = 0;
}
} // namespace wxMSWDateControls
#endif // _MSW_PRIVATE_DATECONTROLS_H_