switch (t->zone_type) {
case TIMELIB_ZONETYPE_ABBR:
case TIMELIB_ZONETYPE_OFFSET:
- return t->z * 60;
+ return (t->z + t->dst) * -60;
case TIMELIB_ZONETYPE_ID:
gmt_offset = timelib_get_time_zone_info(t->sse, t->tz_info);
*/
while (tmp_days <= 0) {
- cur_year--;
- DEBUG(printf("tmp_days=%lld, year=%lld\n", tmp_days, cur_year););
- if (timelib_is_leap(cur_year)) {
- tmp_days += DAYS_PER_LYEAR;
+ if (tmp_days < -1460970) {
+ cur_year -= 4000;
+ DEBUG(printf("tmp_days=%lld, year=%lld\n", tmp_days, cur_year););
+ tmp_days += 1460970;
} else {
- tmp_days += DAYS_PER_YEAR;
+ cur_year--;
+ DEBUG(printf("tmp_days=%lld, year=%lld\n", tmp_days, cur_year););
+ if (timelib_is_leap(cur_year)) {
+ tmp_days += DAYS_PER_LYEAR;
+ } else {
+ tmp_days += DAYS_PER_YEAR;
+ }
}
}
remainder += SECS_PER_DAY;