diff options
author | Derick Rethans <derick@php.net> | 2006-04-11 18:03:52 +0000 |
---|---|---|
committer | Derick Rethans <derick@php.net> | 2006-04-11 18:03:52 +0000 |
commit | 4043f77e36b575ece28c5bfa3fd4297798d6e8c3 (patch) | |
tree | 68280e3e1018ecc51dcbc5fb63bf7203bd42bf49 /ext/date/lib/tm2unixtime.c | |
parent | 4bab5226b284613b7cda0dc5e0283e6b129b6106 (diff) | |
download | php-git-4043f77e36b575ece28c5bfa3fd4297798d6e8c3.tar.gz |
- MFH: Fixed bug #37017 (strtotime fails before 13:00:00 with some time zones
identifiers). (Derick)
- MFH: Fixed bug #36988 (mktime freezes on long numbers). (Derick)
- MFH: Implemented better error and warning handling that is also used for the
date_parse() function.
- MFH: Fixed problems with "T" in front of a time string was seen as a time
zone string.
- MFH: Fixed a problem were 5 and 6 character timezone abbreviations where not
correctly parsed.
Experimental support (All MFH):
- Added the date_parse() function that returns a parsed date/time string
including warnings and errors.
- Added the timezone_name_from_abbr() function that exposes the guessing
mechanism that tries to find a timezone identifier from a timezone
abbreviation and GMT offset.
Diffstat (limited to 'ext/date/lib/tm2unixtime.c')
-rw-r--r-- | ext/date/lib/tm2unixtime.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/date/lib/tm2unixtime.c b/ext/date/lib/tm2unixtime.c index cb4cfeba3a..70094dcad3 100644 --- a/ext/date/lib/tm2unixtime.c +++ b/ext/date/lib/tm2unixtime.c @@ -135,6 +135,13 @@ static timelib_sll do_years(timelib_sll year) { timelib_sll i; timelib_sll res = 0; + timelib_sll eras; + + eras = (year - 1970) / 400; + if (eras != 0) { + year = year - (eras * 400); + res += (SECS_PER_ERA * eras); + } if (year >= 1970) { for (i = year - 1; i >= 1970; i--) { |