X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fbc535ff084f61ec376f339c515d96d74065c18b..7482b22003c03f7aa3335aec271b5fcb48e2693d:/src/common/time.cpp diff --git a/src/common/time.cpp b/src/common/time.cpp index 1d30d65da0..d709f8b212 100644 --- a/src/common/time.cpp +++ b/src/common/time.cpp @@ -104,7 +104,11 @@ wxTime::wxTime() wxTimeInitialized = TRUE; } sec = wxGetCurrentTime(); +#ifdef __SALFORDC__ + sec += (unsigned long) 2177452800; /* seconds from 1/1/01 to 1/1/70 */ +#else sec += 2177452800UL; /* seconds from 1/1/01 to 1/1/70 */ +#endif } wxTime::wxTime(hourTy h, minuteTy m, secondTy s, bool dst) @@ -152,6 +156,7 @@ wxTime::wxTime(const wxDate& date, hourTy h, minuteTy m, secondTy s, bool dst) sec += TIME_ZONE; // adjust to GMT } +#ifndef __SALFORDC__ wxTime::operator wxDate() const /* Convert a wxTime to a local wxDate @@ -164,6 +169,7 @@ wxTime::operator wxDate() const date += daycount; return date; } +#endif bool wxTime::IsBetween(const wxTime& a, const wxTime& b) const { @@ -271,6 +277,38 @@ secondTy wxTime::GetSecond() const return (secondTy)(((sec % 86400) % 3600) % 60); } +secondTy wxTime::GetSecondGMT() const +/* + Return the minute of this wxTime in GMT. +*/ +{ + return (secondTy)(((sec % 86400) % 3600) % 60); +} + +int wxTime::GetDay() const +{ + wxDate da((wxDate) *this); + return da.GetDay(); +} + +int wxTime::GetDayOfWeek() const +{ + wxDate da((wxDate) *this); + return da.GetDayOfWeek(); +} + +int wxTime::GetMonth() const +{ + wxDate da((wxDate) *this); + return da.GetMonth(); +} + +int wxTime::GetYear() const +{ + wxDate da((wxDate) *this); + return da.GetYear(); +} + wxTime wxTime::Max(const wxTime& t) const { if (t < *this) return *this; @@ -283,10 +321,12 @@ wxTime wxTime::Min(const wxTime& t) const return t; } +#ifndef __SALFORDC__ wxTime::operator char *(void) { return FormatTime(); } +#endif void wxTime::SetFormat(const wxTime::tFormat lFormat, const wxTime::tPrecision lPrecision) {