BDateTime: Time_T functions return or take a time_t

* They used an unsigned int, which led to overflows when trying to set
them to a time before January 1st, 1970 (local time)
 * Some things use January 1st, 1970, GMT (or UTC) as a reference point.
In my timezone this leads to such a negative date. An example is cookie
expiration dates which are set to this date to expire them immediately.
Spotted by Opera testsuite.
 * This makes the method unuseable for dates after 2036 (signed 32-bit
time_t will overflow then. This gives us just 33 years to switch to a
64-bit time_t. In te meantime, please try using other methods to set the
date and time for BDateTime objects if you need to go this far.
This commit is contained in:
Adrien Destugues
2013-10-11 08:32:26 +02:00
parent a5ac24f00c
commit d05f9e2d3d
2 changed files with 11 additions and 5 deletions
+2 -2
View File
@@ -189,8 +189,8 @@ public:
const BTime& Time() const;
void SetTime(const BTime &time);
int32 Time_t() const;
void SetTime_t(uint32 seconds);
time_t Time_t() const;
void SetTime_t(time_t seconds);
bool operator!=(const BDateTime& dateTime) const;
bool operator==(const BDateTime& dateTime) const;