X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a83f860948059b0273b5cc6d9e43fadad3ebfca..ddb44248a69593e4b12e4fb08dee7aae217c8c9a:/src/msw/ole/automtn.cpp diff --git a/src/msw/ole/automtn.cpp b/src/msw/ole/automtn.cpp index 31348b791a..127b52b527 100644 --- a/src/msw/ole/automtn.cpp +++ b/src/msw/ole/automtn.cpp @@ -606,11 +606,10 @@ WXDLLEXPORT bool wxConvertVariantToOle(const wxVariant& variant, VARIANTARG& ole wxDateTime date( variant.GetDateTime() ); oleVariant.vt = VT_DATE; - long dosDateTime = date.GetAsDOS(); - short dosDate = short((dosDateTime & 0xFFFF0000) >> 16); - short dosTime = short(dosDateTime & 0xFFFF); + SYSTEMTIME st; + date.GetAsMSWSysTime(&st); - DosDateTimeToVariantTime(dosDate, dosTime, & oleVariant.date); + SystemTimeToVariantTime(&st, &oleVariant.date); } #endif else if (type == wxT("void*")) @@ -772,13 +771,11 @@ wxConvertOleToVariant(const VARIANTARG& oleVariant, wxVariant& variant) case VT_DATE: #if wxUSE_DATETIME { - unsigned short dosDate = 0; - unsigned short dosTime = 0; - VariantTimeToDosDateTime(oleVariant.date, & dosDate, & dosTime); + SYSTEMTIME st; + VariantTimeToSystemTime(oleVariant.date, &st); - long dosDateTime = (dosDate << 16) | dosTime; wxDateTime date; - date.SetFromDOS(dosDateTime); + date.SetFromMSWSysTime(st); variant = date; } #endif // wxUSE_DATETIME