X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bb7afa499a53b8df92f1083b48702810669b61ea..ff7282e135ce73ca6fc4fb4ef037ea2808401272:/src/common/datetime.cpp diff --git a/src/common/datetime.cpp b/src/common/datetime.cpp index 43b767754e..c40dedee2b 100644 --- a/src/common/datetime.cpp +++ b/src/common/datetime.cpp @@ -1496,6 +1496,16 @@ wxDateTime& wxDateTime::ResetTime() return *this; } +wxDateTime wxDateTime::GetDateOnly() const +{ + Tm tm = GetTm(); + tm.msec = + tm.sec = + tm.min = + tm.hour = 0; + return wxDateTime(tm); +} + // ---------------------------------------------------------------------------- // DOS Date and Time Format functions // ---------------------------------------------------------------------------- @@ -2472,7 +2482,7 @@ wxString wxDateTime::Format(const wxChar *format, const TimeZone& tz) const // replace all occurrences of year with it bool wasReplaced = fmt2.Replace(strYear, replacement) > 0; // evaluation order ensures we always attempt the replacement. - wasReplaced = (fmt2.Replace(strYear2, replacement2) > 0) | wasReplaced ; + wasReplaced = (fmt2.Replace(strYear2, replacement2) > 0) || wasReplaced; // use strftime() to format the same date but in supported // year