|
|
|
@@ -68,7 +68,7 @@ static void millisToLocal (const int64 millis, struct tm& result) throw() |
|
|
|
if (seconds < literal64bit (86400) || seconds >= literal64bit (2145916800))
|
|
|
|
{
|
|
|
|
// use extended maths for dates beyond 1970 to 2037..
|
|
|
|
const int timeZoneAdjustment = 86400 - (int) (Time (1970, 0, 2, 0, 0).toMilliseconds() / 1000);
|
|
|
|
const int timeZoneAdjustment = 31536000 - (int) (Time (1971, 0, 1, 0, 0).toMilliseconds() / 1000);
|
|
|
|
const int64 jdm = seconds + timeZoneAdjustment + literal64bit (210866803200);
|
|
|
|
|
|
|
|
const int days = (int) (jdm / literal64bit (86400));
|
|
|
|
@@ -141,14 +141,14 @@ Time::Time (const int year, |
|
|
|
if (year < 1971 || year >= 2038)
|
|
|
|
{
|
|
|
|
// use extended maths for dates beyond 1970 to 2037..
|
|
|
|
const int timeZoneAdjustment = 86400 - (int) (Time (1970, 0, 2, 0, 0).toMilliseconds() / 1000);
|
|
|
|
const int timeZoneAdjustment = 31536000 - (int) (Time (1971, 0, 1, 0, 0).toMilliseconds() / 1000);
|
|
|
|
const int a = (13 - month) / 12;
|
|
|
|
const int y = year + 6700 - a;
|
|
|
|
const int y = year + 4800 - a;
|
|
|
|
const int jd = day + (153 * (month + 12 * a - 2) + 2) / 5
|
|
|
|
+ (y * 365) + (y / 4) - (y / 100) + (y / 400)
|
|
|
|
- 32045;
|
|
|
|
|
|
|
|
const int64 s = jd * literal64bit (86400) - literal64bit (210866803200);
|
|
|
|
const int64 s = ((int64) jd) * literal64bit (86400) - literal64bit (210866803200);
|
|
|
|
|
|
|
|
millisSinceEpoch = 1000 * (s + (hours * 3600 + minutes * 60 + seconds - timeZoneAdjustment))
|
|
|
|
+ milliseconds;
|
|
|
|
|