X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/16630eb7e3ef05fa487b67188df12d10e66a5beb..f6669958924c3c3833e2932b65598b06073d2e65:/include/wx/datetime.h diff --git a/include/wx/datetime.h b/include/wx/datetime.h index f6bb9cdc29..5b6804709a 100644 --- a/include/wx/datetime.h +++ b/include/wx/datetime.h @@ -1781,9 +1781,16 @@ inline wxDateTime wxDateTime::Today() #if (!(defined(__VISAGECPP__) && __IBMCPP__ >= 400)) inline wxDateTime& wxDateTime::Set(time_t timet) { - // assign first to avoid long multiplication overflow! - m_time = timet - WX_TIME_BASE_OFFSET ; - m_time *= TIME_T_FACTOR; + if ( timet == (time_t)-1 ) + { + m_time = wxInvalidDateTime.m_time; + } + else + { + // assign first to avoid long multiplication overflow! + m_time = timet - WX_TIME_BASE_OFFSET; + m_time *= TIME_T_FACTOR; + } return *this; }