diff --git a/include/wx/datetime.h b/include/wx/datetime.h index 351ced98ea..a431fd8e9f 100644 --- a/include/wx/datetime.h +++ b/include/wx/datetime.h @@ -1722,7 +1722,9 @@ protected: inline bool wxDateTime::IsInStdRange() const { - return m_time >= 0l && (m_time / TIME_T_FACTOR) < LONG_MAX; + // currently we don't know what is the real type of time_t so prefer to err + // on the safe side and limit it to 32 bit values which is safe everywhere + return m_time >= 0l && (m_time / TIME_T_FACTOR) < wxINT32_MAX; } /* static */