summaryrefslogtreecommitdiff
path: root/ext/date
diff options
context:
space:
mode:
authorLior Kaplan <kaplanlior@gmail.com>2014-01-11 13:43:40 +0200
committerLior Kaplan <kaplanlior@gmail.com>2014-01-11 13:43:40 +0200
commit650fb41a77b3a24ab4130b05fff243b64b241877 (patch)
treeb64f1cfd733f03ce1db807733ddf87ac8d62a903 /ext/date
parent5a58c4dae727fbc8bd92770c2708baf9e7688857 (diff)
downloadphp-650fb41a77b3a24ab4130b05fff243b64b241877.tar.gz
Imported Upstream version 5.5.8+dfsgupstream/5.5.8+dfsg
Diffstat (limited to 'ext/date')
-rw-r--r--ext/date/lib/dow.c12
-rw-r--r--ext/date/lib/interval.c103
-rw-r--r--ext/date/lib/parse_iso_intervals.c4
-rw-r--r--ext/date/lib/parse_iso_intervals.re2
-rw-r--r--ext/date/lib/timelib.h2
-rw-r--r--ext/date/lib/timezonedb.h730
-rw-r--r--ext/date/lib/unixtime2tm.c9
-rw-r--r--ext/date/php_date.c82
-rw-r--r--ext/date/tests/DateTime_format_basic2.phpt2
-rw-r--r--ext/date/tests/DateTime_verify.phpt4
-rw-r--r--ext/date/tests/bug52063.phpt4
-rw-r--r--ext/date/tests/bug53879.phpt16
-rw-r--r--ext/date/tests/bug63391.phpt20
-rw-r--r--ext/date/tests/date_constants.phpt4
-rw-r--r--ext/date/tests/forward-transition-construction.phpt27
-rw-r--r--ext/date/tests/gmdate_variation13.phpt4
-rw-r--r--ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-ba.phpt96
-rw-r--r--ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd1.phpt48
-rw-r--r--ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd2.phpt56
-rw-r--r--ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bs.phpt92
-rw-r--r--ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fa.phpt58
-rw-r--r--ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fd.phpt58
-rw-r--r--ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fs.phpt67
-rw-r--r--ext/date/tests/rfc-datetime_and_daylight_saving_time-type3.phpt399
-rw-r--r--ext/date/tests/strtotime3-64bit.phpt2
-rw-r--r--ext/date/tests/test-parse-from-format.phpt4
26 files changed, 1068 insertions, 837 deletions
diff --git a/ext/date/lib/dow.c b/ext/date/lib/dow.c
index b6c2d6968..6c296a2ba 100644
--- a/ext/date/lib/dow.c
+++ b/ext/date/lib/dow.c
@@ -25,10 +25,7 @@ static int m_table_leap[13] = { -1, 6, 2, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 }; /* 1
static timelib_sll century_value(timelib_sll j)
{
- timelib_sll i = j - 17;
- timelib_sll c = (4 - i * 2 + (i + 1) / 4) % 7;
-
- return c < 0 ? c + 7 : c;
+ return 6 - (j % 4) * 2;
}
static timelib_sll timelib_day_of_week_ex(timelib_sll y, timelib_sll m, timelib_sll d, int iso)
@@ -36,11 +33,8 @@ static timelib_sll timelib_day_of_week_ex(timelib_sll y, timelib_sll m, timelib_
timelib_sll c1, y1, m1, dow;
/* Only valid for Gregorian calendar, commented out as we don't handle
- * julian calendar. We just return the 'wrong' day of week to be
- * consistent.
- if (y < 1753) {
- return -1;
- } */
+ * Julian calendar. We just return the 'wrong' day of week to be
+ * consistent. */
c1 = century_value(y / 100);
y1 = (y % 100);
m1 = timelib_is_leap(y) ? m_table_leap[m] : m_table_common[m];
diff --git a/ext/date/lib/interval.c b/ext/date/lib/interval.c
index 96867ba2b..dce62f3a2 100644
--- a/ext/date/lib/interval.c
+++ b/ext/date/lib/interval.c
@@ -25,7 +25,7 @@ timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two)
{
timelib_rel_time *rt;
timelib_time *swp;
- timelib_sll dst_h_corr = 0, dst_m_corr = 0;
+ timelib_sll dst_corr = 0 ,dst_h_corr = 0, dst_m_corr = 0;
timelib_time one_backup, two_backup;
rt = timelib_rel_time_ctor();
@@ -43,8 +43,9 @@ timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two)
&& (strcmp(one->tz_info->name, two->tz_info->name) == 0)
&& (one->z != two->z))
{
- dst_h_corr = (two->z - one->z) / 3600;
- dst_m_corr = ((two->z - one->z) % 3600) / 60;
+ dst_corr = two->z - one->z;
+ dst_h_corr = dst_corr / 3600;
+ dst_m_corr = (dst_corr % 3600) / 60;
}
/* Save old TZ info */
@@ -57,16 +58,108 @@ timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two)
rt->y = two->y - one->y;
rt->m = two->m - one->m;
rt->d = two->d - one->d;
- rt->h = two->h - one->h + dst_h_corr;
- rt->i = two->i - one->i + dst_m_corr;
+ rt->h = two->h - one->h;
+ rt->i = two->i - one->i;
rt->s = two->s - one->s;
+ if (one_backup.dst == 0 && two_backup.dst == 1 && two->sse >= one->sse + 86400 - dst_corr) {
+ rt->h += dst_h_corr;
+ rt->i += dst_m_corr;
+ }
+
rt->days = abs(floor((one->sse - two->sse - (dst_h_corr * 3600) - (dst_m_corr * 60)) / 86400));
timelib_do_rel_normalize(rt->invert ? one : two, rt);
+ /* We need to do this after normalisation otherwise we can't get "24H" */
+ if (one_backup.dst == 1 && two_backup.dst == 0 && two->sse >= one->sse + 86400) {
+ if (two->sse < one->sse + 86400 - dst_corr) {
+ rt->d--;
+ rt->h = 24;
+ } else {
+ rt->h += dst_h_corr;
+ rt->i += dst_m_corr;
+ }
+ }
+
/* Restore old TZ info */
memcpy(one, &one_backup, sizeof(one_backup));
memcpy(two, &two_backup, sizeof(two_backup));
return rt;
}
+
+timelib_time *timelib_add(timelib_time *old_time, timelib_rel_time *interval)
+{
+ int bias = 1;
+ timelib_time *t = timelib_time_clone(old_time);
+
+ if (interval->have_weekday_relative || interval->have_special_relative) {
+ memcpy(&t->relative, interval, sizeof(struct timelib_rel_time));
+ } else {
+ if (interval->invert) {
+ bias = -1;
+ }
+ memset(&t->relative, 0, sizeof(struct timelib_rel_time));
+ t->relative.y = interval->y * bias;
+ t->relative.m = interval->m * bias;
+ t->relative.d = interval->d * bias;
+ t->relative.h = interval->h * bias;
+ t->relative.i = interval->i * bias;
+ t->relative.s = interval->s * bias;
+ }
+ t->have_relative = 1;
+ t->sse_uptodate = 0;
+
+ timelib_update_ts(t, NULL);
+
+// printf("%lld %lld %d\n", old_time->dst, t->dst, (t->sse - old_time->sse));
+ /* Adjust for backwards DST changeover */
+ if (old_time->dst == 1 && t->dst == 0 && !interval->y && !interval->m && !interval->d) {
+ t->sse -= old_time->z;
+ t->sse += t->z;
+ }
+
+ timelib_update_from_sse(t);
+ t->have_relative = 0;
+
+ return t;
+}
+
+timelib_time *timelib_sub(timelib_time *old_time, timelib_rel_time *interval)
+{
+ int bias = 1;
+ timelib_time *t = timelib_time_clone(old_time);
+
+ if (interval->invert) {
+ bias = -1;
+ }
+
+ memset(&t->relative, 0, sizeof(struct timelib_rel_time));
+ t->relative.y = 0 - (interval->y * bias);
+ t->relative.m = 0 - (interval->m * bias);
+ t->relative.d = 0 - (interval->d * bias);
+ t->relative.h = 0 - (interval->h * bias);
+ t->relative.i = 0 - (interval->i * bias);
+ t->relative.s = 0 - (interval->s * bias);
+ t->have_relative = 1;
+ t->sse_uptodate = 0;
+
+ timelib_update_ts(t, NULL);
+
+ /* Adjust for backwards DST changeover */
+ if (old_time->dst == 1 && t->dst == 0 && !interval->y && !interval->m && !interval->d) {
+ t->sse -= old_time->z;
+ t->sse += t->z;
+ }
+ /* Adjust for forwards DST changeover */
+ if (old_time->dst == 0 && t->dst == 1 && !interval->y && !interval->m && !interval->d ) {
+ t->sse -= old_time->z;
+ t->sse += t->z;
+ }
+
+ timelib_update_from_sse(t);
+
+ t->have_relative = 0;
+
+ return t;
+}
diff --git a/ext/date/lib/parse_iso_intervals.c b/ext/date/lib/parse_iso_intervals.c
index fedad043c..e669c855a 100644
--- a/ext/date/lib/parse_iso_intervals.c
+++ b/ext/date/lib/parse_iso_intervals.c
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Sun Mar 31 10:48:17 2013 */
+/* Generated by re2c 0.13.5 on Wed Nov 27 11:14:23 2013 */
#line 1 "ext/date/lib/parse_iso_intervals.re"
/*
+----------------------------------------------------------------------+
@@ -380,7 +380,7 @@ yy6:
break;
}
ptr++;
- } while (*ptr);
+ } while (!s->errors->error_count && *ptr);
s->have_period = 1;
TIMELIB_DEINIT;
return TIMELIB_PERIOD;
diff --git a/ext/date/lib/parse_iso_intervals.re b/ext/date/lib/parse_iso_intervals.re
index e50ab37d3..cbbf8781b 100644
--- a/ext/date/lib/parse_iso_intervals.re
+++ b/ext/date/lib/parse_iso_intervals.re
@@ -348,7 +348,7 @@ isoweek = year4 "-"? "W" weekofyear;
break;
}
ptr++;
- } while (*ptr);
+ } while (!s->errors->error_count && *ptr);
s->have_period = 1;
TIMELIB_DEINIT;
return TIMELIB_PERIOD;
diff --git a/ext/date/lib/timelib.h b/ext/date/lib/timelib.h
index dfb7dc030..3f8e1254e 100644
--- a/ext/date/lib/timelib.h
+++ b/ext/date/lib/timelib.h
@@ -138,5 +138,7 @@ int timelib_astro_rise_set_altitude(timelib_time *time, double lon, double lat,
/* from interval.c */
timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two);
+timelib_time *timelib_add(timelib_time *t, timelib_rel_time *interval);
+timelib_time *timelib_sub(timelib_time *t, timelib_rel_time *interval);
#endif
diff --git a/ext/date/lib/timezonedb.h b/ext/date/lib/timezonedb.h
index 91884a935..4a4b04188 100644
--- a/ext/date/lib/timezonedb.h
+++ b/ext/date/lib/timezonedb.h
@@ -232,355 +232,355 @@ const timelib_tzdb_index_entry timezonedb_idx_builtin[579] = {
{ "Asia/Aden" , 0x018C91 },
{ "Asia/Almaty" , 0x018CE6 },
{ "Asia/Amman" , 0x018E65 },
- { "Asia/Anadyr" , 0x019037 },
- { "Asia/Aqtau" , 0x01921C },
- { "Asia/Aqtobe" , 0x01941B },
- { "Asia/Ashgabat" , 0x0195D3 },
- { "Asia/Ashkhabad" , 0x0196F0 },
- { "Asia/Baghdad" , 0x01980D },
- { "Asia/Bahrain" , 0x019982 },
- { "Asia/Baku" , 0x0199E8 },
- { "Asia/Bangkok" , 0x019CD0 },
- { "Asia/Beirut" , 0x019D25 },
- { "Asia/Bishkek" , 0x01A032 },
- { "Asia/Brunei" , 0x01A1DE },
- { "Asia/Calcutta" , 0x01A240 },
- { "Asia/Choibalsan" , 0x01A2B9 },
- { "Asia/Chongqing" , 0x01A432 },
- { "Asia/Chungking" , 0x01A521 },
- { "Asia/Colombo" , 0x01A5D0 },
- { "Asia/Dacca" , 0x01A66C },
- { "Asia/Damascus" , 0x01A712 },
- { "Asia/Dhaka" , 0x01AA62 },
- { "Asia/Dili" , 0x01AB08 },
- { "Asia/Dubai" , 0x01AB92 },
- { "Asia/Dushanbe" , 0x01ABE7 },
- { "Asia/Gaza" , 0x01ACEA },
- { "Asia/Harbin" , 0x01B03D },
- { "Asia/Hebron" , 0x01B124 },
- { "Asia/Ho_Chi_Minh" , 0x01B480 },
- { "Asia/Hong_Kong" , 0x01B4F8 },
- { "Asia/Hovd" , 0x01B6BA },
- { "Asia/Irkutsk" , 0x01B832 },
- { "Asia/Istanbul" , 0x01BA18 },
- { "Asia/Jakarta" , 0x01BE05 },
- { "Asia/Jayapura" , 0x01BEAF },
- { "Asia/Jerusalem" , 0x01BF4B },
- { "Asia/Kabul" , 0x01C27A },
- { "Asia/Kamchatka" , 0x01C2CB },
- { "Asia/Karachi" , 0x01C4A7 },
- { "Asia/Kashgar" , 0x01C55C },
- { "Asia/Kathmandu" , 0x01C62D },
- { "Asia/Katmandu" , 0x01C693 },
- { "Asia/Khandyga" , 0x01C6F9 },
- { "Asia/Kolkata" , 0x01C91E },
- { "Asia/Krasnoyarsk" , 0x01C997 },
- { "Asia/Kuala_Lumpur" , 0x01CB7F },
- { "Asia/Kuching" , 0x01CC3C },
- { "Asia/Kuwait" , 0x01CD2A },
- { "Asia/Macao" , 0x01CD7F },
- { "Asia/Macau" , 0x01CEBA },
- { "Asia/Magadan" , 0x01CFF5 },
- { "Asia/Makassar" , 0x01D1D7 },
- { "Asia/Manila" , 0x01D29C },
- { "Asia/Muscat" , 0x01D321 },
- { "Asia/Nicosia" , 0x01D376 },
- { "Asia/Novokuznetsk" , 0x01D65E },
- { "Asia/Novosibirsk" , 0x01D860 },
- { "Asia/Omsk" , 0x01DA4B },
- { "Asia/Oral" , 0x01DC32 },
- { "Asia/Phnom_Penh" , 0x01DE02 },
- { "Asia/Pontianak" , 0x01DE7A },
- { "Asia/Pyongyang" , 0x01DF3C },
- { "Asia/Qatar" , 0x01DFA9 },
- { "Asia/Qyzylorda" , 0x01E00F },
- { "Asia/Rangoon" , 0x01E1E5 },
- { "Asia/Riyadh" , 0x01E25D },
- { "Asia/Saigon" , 0x01E2B2 },
- { "Asia/Sakhalin" , 0x01E32A },
- { "Asia/Samarkand" , 0x01E521 },
- { "Asia/Seoul" , 0x01E657 },
- { "Asia/Shanghai" , 0x01E6FB },
- { "Asia/Singapore" , 0x01E7DB },
- { "Asia/Taipei" , 0x01E892 },
- { "Asia/Tashkent" , 0x01E9AA },
- { "Asia/Tbilisi" , 0x01EADB },
- { "Asia/Tehran" , 0x01EC95 },
- { "Asia/Tel_Aviv" , 0x01EF03 },
- { "Asia/Thimbu" , 0x01F232 },
- { "Asia/Thimphu" , 0x01F298 },
- { "Asia/Tokyo" , 0x01F2FE },
- { "Asia/Ujung_Pandang" , 0x01F387 },
- { "Asia/Ulaanbaatar" , 0x01F404 },
- { "Asia/Ulan_Bator" , 0x01F55F },
- { "Asia/Urumqi" , 0x01F6AC },
- { "Asia/Ust-Nera" , 0x01F773 },
- { "Asia/Vientiane" , 0x01F978 },
- { "Asia/Vladivostok" , 0x01F9F0 },
- { "Asia/Yakutsk" , 0x01FBDC },
- { "Asia/Yekaterinburg" , 0x01FDC1 },
- { "Asia/Yerevan" , 0x01FFCC },
- { "Atlantic/Azores" , 0x0201CC },
- { "Atlantic/Bermuda" , 0x0206CF },
- { "Atlantic/Canary" , 0x0209B0 },
- { "Atlantic/Cape_Verde" , 0x020C86 },
- { "Atlantic/Faeroe" , 0x020CFF },
- { "Atlantic/Faroe" , 0x020FA3 },
- { "Atlantic/Jan_Mayen" , 0x021247 },
- { "Atlantic/Madeira" , 0x021579 },
- { "Atlantic/Reykjavik" , 0x021A82 },
- { "Atlantic/South_Georgia" , 0x021C3B },
- { "Atlantic/St_Helena" , 0x021E4D },
- { "Atlantic/Stanley" , 0x021C7F },
- { "Australia/ACT" , 0x021EA2 },
- { "Australia/Adelaide" , 0x0221BF },
- { "Australia/Brisbane" , 0x0224EB },
- { "Australia/Broken_Hill" , 0x0225B2 },
- { "Australia/Canberra" , 0x0228F0 },
- { "Australia/Currie" , 0x022C0D },
- { "Australia/Darwin" , 0x022F40 },
- { "Australia/Eucla" , 0x022FC6 },
- { "Australia/Hobart" , 0x02309B },
- { "Australia/LHI" , 0x0233F9 },
- { "Australia/Lindeman" , 0x023694 },
- { "Australia/Lord_Howe" , 0x023775 },
- { "Australia/Melbourne" , 0x023A20 },
- { "Australia/North" , 0x023D45 },
- { "Australia/NSW" , 0x023DB9 },
- { "Australia/Perth" , 0x0240D6 },
- { "Australia/Queensland" , 0x0241AE },
- { "Australia/South" , 0x02425A },
- { "Australia/Sydney" , 0x024577 },
- { "Australia/Tasmania" , 0x0248B4 },
- { "Australia/Victoria" , 0x024BF9 },
- { "Australia/West" , 0x024F16 },
- { "Australia/Yancowinna" , 0x024FCC },
- { "Brazil/Acre" , 0x0252EE },
- { "Brazil/DeNoronha" , 0x0253F2 },
- { "Brazil/East" , 0x025512 },
- { "Brazil/West" , 0x0257EF },
- { "Canada/Atlantic" , 0x0258E7 },
- { "Canada/Central" , 0x025DCF },
- { "Canada/East-Saskatchewan" , 0x0266D9 },
- { "Canada/Eastern" , 0x0261E9 },
- { "Canada/Mountain" , 0x026862 },
- { "Canada/Newfoundland" , 0x026BD8 },
- { "Canada/Pacific" , 0x027103 },
- { "Canada/Saskatchewan" , 0x02751C },
- { "Canada/Yukon" , 0x0276A5 },
- { "CET" , 0x0279A8 },
- { "Chile/Continental" , 0x027CB1 },
- { "Chile/EasterIsland" , 0x02804C },
- { "CST6CDT" , 0x02838E },
- { "Cuba" , 0x0286DF },
- { "EET" , 0x028A52 },
- { "Egypt" , 0x028D05 },
- { "Eire" , 0x028FC8 },
- { "EST" , 0x0294D9 },
- { "EST5EDT" , 0x02951D },
- { "Etc/GMT" , 0x02986E },
- { "Etc/GMT+0" , 0x02993A },
- { "Etc/GMT+1" , 0x0299C4 },
- { "Etc/GMT+10" , 0x029A51 },
- { "Etc/GMT+11" , 0x029ADF },
- { "Etc/GMT+12" , 0x029B6D },
- { "Etc/GMT+2" , 0x029C88 },
- { "Etc/GMT+3" , 0x029D14 },
- { "Etc/GMT+4" , 0x029DA0 },
- { "Etc/GMT+5" , 0x029E2C },
- { "Etc/GMT+6" , 0x029EB8 },
- { "Etc/GMT+7" , 0x029F44 },
- { "Etc/GMT+8" , 0x029FD0 },
- { "Etc/GMT+9" , 0x02A05C },
- { "Etc/GMT-0" , 0x0298F6 },
- { "Etc/GMT-1" , 0x02997E },
- { "Etc/GMT-10" , 0x029A0A },
- { "Etc/GMT-11" , 0x029A98 },
- { "Etc/GMT-12" , 0x029B26 },
- { "Etc/GMT-13" , 0x029BB4 },
- { "Etc/GMT-14" , 0x029BFB },
- { "Etc/GMT-2" , 0x029C42 },
- { "Etc/GMT-3" , 0x029CCE },
- { "Etc/GMT-4" , 0x029D5A },
- { "Etc/GMT-5" , 0x029DE6 },
- { "Etc/GMT-6" , 0x029E72 },
- { "Etc/GMT-7" , 0x029EFE },
- { "Etc/GMT-8" , 0x029F8A },
- { "Etc/GMT-9" , 0x02A016 },
- { "Etc/GMT0" , 0x0298B2 },
- { "Etc/Greenwich" , 0x02A0A2 },
- { "Etc/UCT" , 0x02A0E6 },
- { "Etc/Universal" , 0x02A12A },
- { "Etc/UTC" , 0x02A16E },
- { "Etc/Zulu" , 0x02A1B2 },
- { "Europe/Amsterdam" , 0x02A1F6 },
- { "Europe/Andorra" , 0x02A634 },
- { "Europe/Athens" , 0x02A8B0 },
- { "Europe/Belfast" , 0x02ABF3 },
- { "Europe/Belgrade" , 0x02B12A },
- { "Europe/Berlin" , 0x02B3F3 },
- { "Europe/Bratislava" , 0x02B757 },
- { "Europe/Brussels" , 0x02BA89 },
- { "Europe/Bucharest" , 0x02BEC0 },
- { "Europe/Budapest" , 0x02C1EA },
- { "Europe/Busingen" , 0x02C55D },
- { "Europe/Chisinau" , 0x02C814 },
- { "Europe/Copenhagen" , 0x02CBA2 },
- { "Europe/Dublin" , 0x02CEAC },
- { "Europe/Gibraltar" , 0x02D3BD },
- { "Europe/Guernsey" , 0x02D814 },
- { "Europe/Helsinki" , 0x02DD4B },
- { "Europe/Isle_of_Man" , 0x02E001 },
- { "Europe/Istanbul" , 0x02E538 },
- { "Europe/Jersey" , 0x02E925 },
- { "Europe/Kaliningrad" , 0x02EE5C },
- { "Europe/Kiev" , 0x02F0C2 },
- { "Europe/Lisbon" , 0x02F3D9 },
- { "Europe/Ljubljana" , 0x02F8DD },
- { "Europe/London" , 0x02FBA6 },
- { "Europe/Luxembourg" , 0x0300DD },
- { "Europe/Madrid" , 0x030533 },
- { "Europe/Malta" , 0x0308F9 },
- { "Europe/Mariehamn" , 0x030CB2 },
- { "Europe/Minsk" , 0x030F68 },
- { "Europe/Monaco" , 0x031176 },
- { "Europe/Moscow" , 0x0315B1 },
- { "Europe/Nicosia" , 0x031802 },
- { "Europe/Oslo" , 0x031AEA },
- { "Europe/Paris" , 0x031E1C },
- { "Europe/Podgorica" , 0x032262 },
- { "Europe/Prague" , 0x03252B },
- { "Europe/Riga" , 0x03285D },
- { "Europe/Rome" , 0x032BA2 },
- { "Europe/Samara" , 0x032F65 },
- { "Europe/San_Marino" , 0x033198 },
- { "Europe/Sarajevo" , 0x03355B },
- { "Europe/Simferopol" , 0x033824 },
- { "Europe/Skopje" , 0x033B4F },
- { "Europe/Sofia" , 0x033E18 },
- { "Europe/Stockholm" , 0x034120 },
- { "Europe/Tallinn" , 0x0343CF },
- { "Europe/Tirane" , 0x034709 },
- { "Europe/Tiraspol" , 0x034A0F },
- { "Europe/Uzhgorod" , 0x034D9D },
- { "Europe/Vaduz" , 0x0350B4 },
- { "Europe/Vatican" , 0x035363 },
- { "Europe/Vienna" , 0x035726 },
- { "Europe/Vilnius" , 0x035A53 },
- { "Europe/Volgograd" , 0x035D92 },
- { "Europe/Warsaw" , 0x035F92 },
- { "Europe/Zagreb" , 0x036373 },
- { "Europe/Zaporozhye" , 0x03663C },
- { "Europe/Zurich" , 0x03697D },
- { "Factory" , 0x036C2C },
- { "GB" , 0x036C9D },
- { "GB-Eire" , 0x0371D4 },
- { "GMT" , 0x03770B },
- { "GMT+0" , 0x0377D7 },
- { "GMT-0" , 0x037793 },
- { "GMT0" , 0x03774F },
- { "Greenwich" , 0x03781B },
- { "Hongkong" , 0x03785F },
- { "HST" , 0x037A21 },
- { "Iceland" , 0x037A65 },
- { "Indian/Antananarivo" , 0x037C1E },
- { "Indian/Chagos" , 0x037C92 },
- { "Indian/Christmas" , 0x037CF4 },
- { "Indian/Cocos" , 0x037D38 },
- { "Indian/Comoro" , 0x037D7C },
- { "Indian/Kerguelen" , 0x037DD1 },
- { "Indian/Mahe" , 0x037E26 },
- { "Indian/Maldives" , 0x037E7B },
- { "Indian/Mauritius" , 0x037ED0 },
- { "Indian/Mayotte" , 0x037F46 },
- { "Indian/Reunion" , 0x037F9B },
- { "Iran" , 0x037FF0 },
- { "Israel" , 0x03825E },
- { "Jamaica" , 0x03858D },
- { "Japan" , 0x038652 },
- { "Kwajalein" , 0x0386DB },
- { "Libya" , 0x03873E },
- { "MET" , 0x038847 },
- { "Mexico/BajaNorte" , 0x038B50 },
- { "Mexico/BajaSur" , 0x038EB9 },
- { "Mexico/General" , 0x0390FE },
- { "MST" , 0x03935C },
- { "MST7MDT" , 0x0393A0 },
- { "Navajo" , 0x0396F1 },
- { "NZ" , 0x039A6A },
- { "NZ-CHAT" , 0x039DE8 },
- { "Pacific/Apia" , 0x03A0D0 },
- { "Pacific/Auckland" , 0x03A26C },
- { "Pacific/Chatham" , 0x03A5F8 },
- { "Pacific/Chuuk" , 0x03A8EF },
- { "Pacific/Easter" , 0x03A948 },
- { "Pacific/Efate" , 0x03ACA6 },
- { "Pacific/Enderbury" , 0x03AD6C },
- { "Pacific/Fakaofo" , 0x03ADDA },
- { "Pacific/Fiji" , 0x03AE2B },
- { "Pacific/Funafuti" , 0x03AFBE },
- { "Pacific/Galapagos" , 0x03B002 },
- { "Pacific/Gambier" , 0x03B07A },
- { "Pacific/Guadalcanal" , 0x03B0DF },
- { "Pacific/Guam" , 0x03B134 },
- { "Pacific/Honolulu" , 0x03B18A },
- { "Pacific/Johnston" , 0x03B201 },
- { "Pacific/Kiritimati" , 0x03B280 },
- { "Pacific/Kosrae" , 0x03B2EB },
- { "Pacific/Kwajalein" , 0x03B348 },
- { "Pacific/Majuro" , 0x03B3B4 },
- { "Pacific/Marquesas" , 0x03B413 },
- { "Pacific/Midway" , 0x03B47A },
- { "Pacific/Nauru" , 0x03B504 },
- { "Pacific/Niue" , 0x03B57C },
- { "Pacific/Norfolk" , 0x03B5DA },
- { "Pacific/Noumea" , 0x03B62F },
- { "Pacific/Pago_Pago" , 0x03B6BF },
- { "Pacific/Palau" , 0x03B748 },
- { "Pacific/Pitcairn" , 0x03B78C },
- { "Pacific/Pohnpei" , 0x03B7E1 },
- { "Pacific/Ponape" , 0x03B836 },
- { "Pacific/Port_Moresby" , 0x03B87B },
- { "Pacific/Rarotonga" , 0x03B8BF },
- { "Pacific/Saipan" , 0x03B99B },
- { "Pacific/Samoa" , 0x03B9FE },
- { "Pacific/Tahiti" , 0x03BA87 },
- { "Pacific/Tarawa" , 0x03BAEC },
- { "Pacific/Tongatapu" , 0x03BB40 },
- { "Pacific/Truk" , 0x03BBCC },
- { "Pacific/Wake" , 0x03BC11 },
- { "Pacific/Wallis" , 0x03BC61 },
- { "Pacific/Yap" , 0x03BCA5 },
- { "Poland" , 0x03BCEA },
- { "Portugal" , 0x03C0CB },
- { "PRC" , 0x03C5C7 },
- { "PST8PDT" , 0x03C678 },
- { "ROC" , 0x03C9C9 },
- { "ROK" , 0x03CAE1 },
- { "Singapore" , 0x03CB85 },
- { "Turkey" , 0x03CC3C },
- { "UCT" , 0x03D029 },
- { "Universal" , 0x03D06D },
- { "US/Alaska" , 0x03D0B1 },
- { "US/Aleutian" , 0x03D41A },
- { "US/Arizona" , 0x03D780 },
- { "US/Central" , 0x03D80E },
- { "US/East-Indiana" , 0x03E218 },
- { "US/Eastern" , 0x03DD19 },
- { "US/Hawaii" , 0x03E482 },
- { "US/Indiana-Starke" , 0x03E4F3 },
- { "US/Michigan" , 0x03E864 },
- { "US/Mountain" , 0x03EB9B },
- { "US/Pacific" , 0x03EF14 },
- { "US/Pacific-New" , 0x03F319 },
- { "US/Samoa" , 0x03F71E },
- { "UTC" , 0x03F7A7 },
- { "W-SU" , 0x03FA9E },
- { "WET" , 0x03F7EB },
- { "Zulu" , 0x03FCD8 },
+ { "Asia/Anadyr" , 0x01911B },
+ { "Asia/Aqtau" , 0x019300 },
+ { "Asia/Aqtobe" , 0x0194FF },
+ { "Asia/Ashgabat" , 0x0196B7 },
+ { "Asia/Ashkhabad" , 0x0197D4 },
+ { "Asia/Baghdad" , 0x0198F1 },
+ { "Asia/Bahrain" , 0x019A66 },
+ { "Asia/Baku" , 0x019ACC },
+ { "Asia/Bangkok" , 0x019DB4 },
+ { "Asia/Beirut" , 0x019E09 },
+ { "Asia/Bishkek" , 0x01A116 },
+ { "Asia/Brunei" , 0x01A2C2 },
+ { "Asia/Calcutta" , 0x01A324 },
+ { "Asia/Choibalsan" , 0x01A39D },
+ { "Asia/Chongqing" , 0x01A516 },
+ { "Asia/Chungking" , 0x01A605 },
+ { "Asia/Colombo" , 0x01A6B4 },
+ { "Asia/Dacca" , 0x01A750 },
+ { "Asia/Damascus" , 0x01A7F6 },
+ { "Asia/Dhaka" , 0x01AB46 },
+ { "Asia/Dili" , 0x01ABEC },
+ { "Asia/Dubai" , 0x01AC76 },
+ { "Asia/Dushanbe" , 0x01ACCB },
+ { "Asia/Gaza" , 0x01ADCE },
+ { "Asia/Harbin" , 0x01B121 },
+ { "Asia/Hebron" , 0x01B208 },
+ { "Asia/Ho_Chi_Minh" , 0x01B564 },
+ { "Asia/Hong_Kong" , 0x01B5DC },
+ { "Asia/Hovd" , 0x01B79E },
+ { "Asia/Irkutsk" , 0x01B916 },
+ { "Asia/Istanbul" , 0x01BAFC },
+ { "Asia/Jakarta" , 0x01BEE9 },
+ { "Asia/Jayapura" , 0x01BF93 },
+ { "Asia/Jerusalem" , 0x01C02F },
+ { "Asia/Kabul" , 0x01C35E },
+ { "Asia/Kamchatka" , 0x01C3AF },
+ { "Asia/Karachi" , 0x01C58B },
+ { "Asia/Kashgar" , 0x01C640 },
+ { "Asia/Kathmandu" , 0x01C711 },
+ { "Asia/Katmandu" , 0x01C777 },
+ { "Asia/Khandyga" , 0x01C7DD },
+ { "Asia/Kolkata" , 0x01CA02 },
+ { "Asia/Krasnoyarsk" , 0x01CA7B },
+ { "Asia/Kuala_Lumpur" , 0x01CC63 },
+ { "Asia/Kuching" , 0x01CD20 },
+ { "Asia/Kuwait" , 0x01CE0E },
+ { "Asia/Macao" , 0x01CE63 },
+ { "Asia/Macau" , 0x01CF9E },
+ { "Asia/Magadan" , 0x01D0D9 },
+ { "Asia/Makassar" , 0x01D2BB },
+ { "Asia/Manila" , 0x01D380 },
+ { "Asia/Muscat" , 0x01D405 },
+ { "Asia/Nicosia" , 0x01D45A },
+ { "Asia/Novokuznetsk" , 0x01D742 },
+ { "Asia/Novosibirsk" , 0x01D944 },
+ { "Asia/Omsk" , 0x01DB2F },
+ { "Asia/Oral" , 0x01DD16 },
+ { "Asia/Phnom_Penh" , 0x01DEE6 },
+ { "Asia/Pontianak" , 0x01DF5E },
+ { "Asia/Pyongyang" , 0x01E020 },
+ { "Asia/Qatar" , 0x01E08D },
+ { "Asia/Qyzylorda" , 0x01E0F3 },
+ { "Asia/Rangoon" , 0x01E2C9 },
+ { "Asia/Riyadh" , 0x01E341 },
+ { "Asia/Saigon" , 0x01E396 },
+ { "Asia/Sakhalin" , 0x01E40E },
+ { "Asia/Samarkand" , 0x01E605 },
+ { "Asia/Seoul" , 0x01E73B },
+ { "Asia/Shanghai" , 0x01E7DF },
+ { "Asia/Singapore" , 0x01E8BF },
+ { "Asia/Taipei" , 0x01E976 },
+ { "Asia/Tashkent" , 0x01EA8E },
+ { "Asia/Tbilisi" , 0x01EBBF },
+ { "Asia/Tehran" , 0x01ED79 },
+ { "Asia/Tel_Aviv" , 0x01EFE7 },
+ { "Asia/Thimbu" , 0x01F316 },
+ { "Asia/Thimphu" , 0x01F37C },
+ { "Asia/Tokyo" , 0x01F3E2 },
+ { "Asia/Ujung_Pandang" , 0x01F46B },
+ { "Asia/Ulaanbaatar" , 0x01F4E8 },
+ { "Asia/Ulan_Bator" , 0x01F643 },
+ { "Asia/Urumqi" , 0x01F790 },
+ { "Asia/Ust-Nera" , 0x01F857 },
+ { "Asia/Vientiane" , 0x01FA5C },
+ { "Asia/Vladivostok" , 0x01FAD4 },
+ { "Asia/Yakutsk" , 0x01FCC0 },
+ { "Asia/Yekaterinburg" , 0x01FEA5 },
+ { "Asia/Yerevan" , 0x0200B0 },
+ { "Atlantic/Azores" , 0x0202B0 },
+ { "Atlantic/Bermuda" , 0x0207B3 },
+ { "Atlantic/Canary" , 0x020A94 },
+ { "Atlantic/Cape_Verde" , 0x020D6A },
+ { "Atlantic/Faeroe" , 0x020DE3 },
+ { "Atlantic/Faroe" , 0x021087 },
+ { "Atlantic/Jan_Mayen" , 0x02132B },
+ { "Atlantic/Madeira" , 0x02165D },
+ { "Atlantic/Reykjavik" , 0x021B66 },
+ { "Atlantic/South_Georgia" , 0x021D1F },
+ { "Atlantic/St_Helena" , 0x021F31 },
+ { "Atlantic/Stanley" , 0x021D63 },
+ { "Australia/ACT" , 0x021F86 },
+ { "Australia/Adelaide" , 0x0222A3 },
+ { "Australia/Brisbane" , 0x0225CF },
+ { "Australia/Broken_Hill" , 0x022696 },
+ { "Australia/Canberra" , 0x0229D4 },
+ { "Australia/Currie" , 0x022CF1 },
+ { "Australia/Darwin" , 0x023024 },
+ { "Australia/Eucla" , 0x0230AA },
+ { "Australia/Hobart" , 0x02317F },
+ { "Australia/LHI" , 0x0234DD },
+ { "Australia/Lindeman" , 0x023778 },
+ { "Australia/Lord_Howe" , 0x023859 },
+ { "Australia/Melbourne" , 0x023B04 },
+ { "Australia/North" , 0x023E29 },
+ { "Australia/NSW" , 0x023E9D },
+ { "Australia/Perth" , 0x0241BA },
+ { "Australia/Queensland" , 0x024292 },
+ { "Australia/South" , 0x02433E },
+ { "Australia/Sydney" , 0x02465B },
+ { "Australia/Tasmania" , 0x024998 },
+ { "Australia/Victoria" , 0x024CDD },
+ { "Australia/West" , 0x024FFA },
+ { "Australia/Yancowinna" , 0x0250B0 },
+ { "Brazil/Acre" , 0x0253D2 },
+ { "Brazil/DeNoronha" , 0x0254D6 },
+ { "Brazil/East" , 0x0255F6 },
+ { "Brazil/West" , 0x0258D3 },
+ { "Canada/Atlantic" , 0x0259CB },
+ { "Canada/Central" , 0x025EB3 },
+ { "Canada/East-Saskatchewan" , 0x0267BD },
+ { "Canada/Eastern" , 0x0262CD },
+ { "Canada/Mountain" , 0x026946 },
+ { "Canada/Newfoundland" , 0x026CBC },
+ { "Canada/Pacific" , 0x0271E7 },
+ { "Canada/Saskatchewan" , 0x027600 },
+ { "Canada/Yukon" , 0x027789 },
+ { "CET" , 0x027A8C },
+ { "Chile/Continental" , 0x027D95 },
+ { "Chile/EasterIsland" , 0x028130 },
+ { "CST6CDT" , 0x028472 },
+ { "Cuba" , 0x0287C3 },
+ { "EET" , 0x028B36 },
+ { "Egypt" , 0x028DE9 },
+ { "Eire" , 0x0290AC },
+ { "EST" , 0x0295BD },
+ { "EST5EDT" , 0x029601 },
+ { "Etc/GMT" , 0x029952 },
+ { "Etc/GMT+0" , 0x029A1E },
+ { "Etc/GMT+1" , 0x029AA8 },
+ { "Etc/GMT+10" , 0x029B35 },
+ { "Etc/GMT+11" , 0x029BC3 },
+ { "Etc/GMT+12" , 0x029C51 },
+ { "Etc/GMT+2" , 0x029D6C },
+ { "Etc/GMT+3" , 0x029DF8 },
+ { "Etc/GMT+4" , 0x029E84 },
+ { "Etc/GMT+5" , 0x029F10 },
+ { "Etc/GMT+6" , 0x029F9C },
+ { "Etc/GMT+7" , 0x02A028 },
+ { "Etc/GMT+8" , 0x02A0B4 },
+ { "Etc/GMT+9" , 0x02A140 },
+ { "Etc/GMT-0" , 0x0299DA },
+ { "Etc/GMT-1" , 0x029A62 },
+ { "Etc/GMT-10" , 0x029AEE },
+ { "Etc/GMT-11" , 0x029B7C },
+ { "Etc/GMT-12" , 0x029C0A },
+ { "Etc/GMT-13" , 0x029C98 },
+ { "Etc/GMT-14" , 0x029CDF },
+ { "Etc/GMT-2" , 0x029D26 },
+ { "Etc/GMT-3" , 0x029DB2 },
+ { "Etc/GMT-4" , 0x029E3E },
+ { "Etc/GMT-5" , 0x029ECA },
+ { "Etc/GMT-6" , 0x029F56 },
+ { "Etc/GMT-7" , 0x029FE2 },
+ { "Etc/GMT-8" , 0x02A06E },
+ { "Etc/GMT-9" , 0x02A0FA },
+ { "Etc/GMT0" , 0x029996 },
+ { "Etc/Greenwich" , 0x02A186 },
+ { "Etc/UCT" , 0x02A1CA },
+ { "Etc/Universal" , 0x02A20E },
+ { "Etc/UTC" , 0x02A252 },
+ { "Etc/Zulu" , 0x02A296 },
+ { "Europe/Amsterdam" , 0x02A2DA },
+ { "Europe/Andorra" , 0x02A718 },
+ { "Europe/Athens" , 0x02A994 },
+ { "Europe/Belfast" , 0x02ACD7 },
+ { "Europe/Belgrade" , 0x02B20E },
+ { "Europe/Berlin" , 0x02B4D7 },
+ { "Europe/Bratislava" , 0x02B83B },
+ { "Europe/Brussels" , 0x02BB6D },
+ { "Europe/Bucharest" , 0x02BFA4 },
+ { "Europe/Budapest" , 0x02C2CE },
+ { "Europe/Busingen" , 0x02C641 },
+ { "Europe/Chisinau" , 0x02C8F8 },
+ { "Europe/Copenhagen" , 0x02CC86 },
+ { "Europe/Dublin" , 0x02CF90 },
+ { "Europe/Gibraltar" , 0x02D4A1 },
+ { "Europe/Guernsey" , 0x02D8F8 },
+ { "Europe/Helsinki" , 0x02DE2F },
+ { "Europe/Isle_of_Man" , 0x02E0E5 },
+ { "Europe/Istanbul" , 0x02E61C },
+ { "Europe/Jersey" , 0x02EA09 },
+ { "Europe/Kaliningrad" , 0x02EF40 },
+ { "Europe/Kiev" , 0x02F1A6 },
+ { "Europe/Lisbon" , 0x02F4BD },
+ { "Europe/Ljubljana" , 0x02F9C1 },
+ { "Europe/London" , 0x02FC8A },
+ { "Europe/Luxembourg" , 0x0301C1 },
+ { "Europe/Madrid" , 0x030617 },
+ { "Europe/Malta" , 0x0309DD },
+ { "Europe/Mariehamn" , 0x030D96 },
+ { "Europe/Minsk" , 0x03104C },
+ { "Europe/Monaco" , 0x03125A },
+ { "Europe/Moscow" , 0x031695 },
+ { "Europe/Nicosia" , 0x0318E6 },
+ { "Europe/Oslo" , 0x031BCE },
+ { "Europe/Paris" , 0x031F00 },
+ { "Europe/Podgorica" , 0x032346 },
+ { "Europe/Prague" , 0x03260F },
+ { "Europe/Riga" , 0x032941 },
+ { "Europe/Rome" , 0x032C86 },
+ { "Europe/Samara" , 0x033049 },
+ { "Europe/San_Marino" , 0x03327C },
+ { "Europe/Sarajevo" , 0x03363F },
+ { "Europe/Simferopol" , 0x033908 },
+ { "Europe/Skopje" , 0x033C33 },
+ { "Europe/Sofia" , 0x033EFC },
+ { "Europe/Stockholm" , 0x034204 },
+ { "Europe/Tallinn" , 0x0344B3 },
+ { "Europe/Tirane" , 0x0347ED },
+ { "Europe/Tiraspol" , 0x034AF3 },
+ { "Europe/Uzhgorod" , 0x034E81 },
+ { "Europe/Vaduz" , 0x035198 },
+ { "Europe/Vatican" , 0x035447 },
+ { "Europe/Vienna" , 0x03580A },
+ { "Europe/Vilnius" , 0x035B37 },
+ { "Europe/Volgograd" , 0x035E76 },
+ { "Europe/Warsaw" , 0x036076 },
+ { "Europe/Zagreb" , 0x036457 },
+ { "Europe/Zaporozhye" , 0x036720 },
+ { "Europe/Zurich" , 0x036A61 },
+ { "Factory" , 0x036D10 },
+ { "GB" , 0x036D81 },
+ { "GB-Eire" , 0x0372B8 },
+ { "GMT" , 0x0377EF },
+ { "GMT+0" , 0x0378BB },
+ { "GMT-0" , 0x037877 },
+ { "GMT0" , 0x037833 },
+ { "Greenwich" , 0x0378FF },
+ { "Hongkong" , 0x037943 },
+ { "HST" , 0x037B05 },
+ { "Iceland" , 0x037B49 },
+ { "Indian/Antananarivo" , 0x037D02 },
+ { "Indian/Chagos" , 0x037D76 },
+ { "Indian/Christmas" , 0x037DD8 },
+ { "Indian/Cocos" , 0x037E1C },
+ { "Indian/Comoro" , 0x037E60 },
+ { "Indian/Kerguelen" , 0x037EB5 },
+ { "Indian/Mahe" , 0x037F0A },
+ { "Indian/Maldives" , 0x037F5F },
+ { "Indian/Mauritius" , 0x037FB4 },
+ { "Indian/Mayotte" , 0x03802A },
+ { "Indian/Reunion" , 0x03807F },
+ { "Iran" , 0x0380D4 },
+ { "Israel" , 0x038342 },
+ { "Jamaica" , 0x038671 },
+ { "Japan" , 0x038736 },
+ { "Kwajalein" , 0x0387BF },
+ { "Libya" , 0x038822 },
+ { "MET" , 0x03892B },
+ { "Mexico/BajaNorte" , 0x038C34 },
+ { "Mexico/BajaSur" , 0x038F9D },
+ { "Mexico/General" , 0x0391E2 },
+ { "MST" , 0x039440 },
+ { "MST7MDT" , 0x039484 },
+ { "Navajo" , 0x0397D5 },
+ { "NZ" , 0x039B4E },
+ { "NZ-CHAT" , 0x039ECC },
+ { "Pacific/Apia" , 0x03A1B4 },
+ { "Pacific/Auckland" , 0x03A350 },
+ { "Pacific/Chatham" , 0x03A6DC },
+ { "Pacific/Chuuk" , 0x03A9D3 },
+ { "Pacific/Easter" , 0x03AA2C },
+ { "Pacific/Efate" , 0x03AD8A },
+ { "Pacific/Enderbury" , 0x03AE50 },
+ { "Pacific/Fakaofo" , 0x03AEBE },
+ { "Pacific/Fiji" , 0x03AF0F },
+ { "Pacific/Funafuti" , 0x03B0A2 },
+ { "Pacific/Galapagos" , 0x03B0E6 },
+ { "Pacific/Gambier" , 0x03B15E },
+ { "Pacific/Guadalcanal" , 0x03B1C3 },
+ { "Pacific/Guam" , 0x03B218 },
+ { "Pacific/Honolulu" , 0x03B26E },
+ { "Pacific/Johnston" , 0x03B2E5 },
+ { "Pacific/Kiritimati" , 0x03B364 },
+ { "Pacific/Kosrae" , 0x03B3CF },
+ { "Pacific/Kwajalein" , 0x03B42C },
+ { "Pacific/Majuro" , 0x03B498 },
+ { "Pacific/Marquesas" , 0x03B4F7 },
+ { "Pacific/Midway" , 0x03B55E },
+ { "Pacific/Nauru" , 0x03B5E8 },
+ { "Pacific/Niue" , 0x03B660 },
+ { "Pacific/Norfolk" , 0x03B6BE },
+ { "Pacific/Noumea" , 0x03B713 },
+ { "Pacific/Pago_Pago" , 0x03B7A3 },
+ { "Pacific/Palau" , 0x03B82C },
+ { "Pacific/Pitcairn" , 0x03B870 },
+ { "Pacific/Pohnpei" , 0x03B8C5 },
+ { "Pacific/Ponape" , 0x03B91A },
+ { "Pacific/Port_Moresby" , 0x03B95F },
+ { "Pacific/Rarotonga" , 0x03B9A3 },
+ { "Pacific/Saipan" , 0x03BA7F },
+ { "Pacific/Samoa" , 0x03BAE2 },
+ { "Pacific/Tahiti" , 0x03BB6B },
+ { "Pacific/Tarawa" , 0x03BBD0 },
+ { "Pacific/Tongatapu" , 0x03BC24 },
+ { "Pacific/Truk" , 0x03BCB0 },
+ { "Pacific/Wake" , 0x03BCF5 },
+ { "Pacific/Wallis" , 0x03BD45 },
+ { "Pacific/Yap" , 0x03BD89 },
+ { "Poland" , 0x03BDCE },
+ { "Portugal" , 0x03C1AF },
+ { "PRC" , 0x03C6AB },
+ { "PST8PDT" , 0x03C75C },
+ { "ROC" , 0x03CAAD },
+ { "ROK" , 0x03CBC5 },
+ { "Singapore" , 0x03CC69 },
+ { "Turkey" , 0x03CD20 },
+ { "UCT" , 0x03D10D },
+ { "Universal" , 0x03D151 },
+ { "US/Alaska" , 0x03D195 },
+ { "US/Aleutian" , 0x03D4FE },
+ { "US/Arizona" , 0x03D864 },
+ { "US/Central" , 0x03D8F2 },
+ { "US/East-Indiana" , 0x03E2FC },
+ { "US/Eastern" , 0x03DDFD },
+ { "US/Hawaii" , 0x03E566 },
+ { "US/Indiana-Starke" , 0x03E5D7 },
+ { "US/Michigan" , 0x03E948 },
+ { "US/Mountain" , 0x03EC7F },
+ { "US/Pacific" , 0x03EFF8 },
+ { "US/Pacific-New" , 0x03F3FD },
+ { "US/Samoa" , 0x03F802 },
+ { "UTC" , 0x03F88B },
+ { "W-SU" , 0x03FB82 },
+ { "WET" , 0x03F8CF },
+ { "Zulu" , 0x03FDBC },
};
/* This is a generated file, do not modify */
-const unsigned char timelib_timezone_db_data_builtin[261404] = {
+const unsigned char timelib_timezone_db_data_builtin[261632] = {
/* Africa/Abidjan */
@@ -3490,7 +3490,7 @@ const unsigned char timelib_timezone_db_data_builtin[261404] = {
0x33, 0x47, 0x2D, 0xD0, 0x34, 0x40, 0x59, 0x50, 0x35, 0x1D, 0xD5, 0x50, 0x36, 0x32, 0xB0, 0x50,
0x36, 0xFD, 0xB7, 0x50, 0x38, 0x1B, 0xCC, 0xD0, 0x38, 0xE6, 0xD3, 0xD0, 0x39, 0xFB, 0xAE, 0xD0,
0x3A, 0xC6, 0xB5, 0xD0, 0x3B, 0xDB, 0x90, 0xD0, 0x3C, 0xAF, 0xD2, 0x50, 0x3D, 0xBB, 0x72, 0xD0,
-0x3E, 0x8F, 0xB4, 0x50, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x6F, 0x96, 0x50, 0x45, 0x44, 0x35, 0x50,
+0x3E, 0x8F, 0xB4, 0x50, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x66, 0x5B, 0xD0, 0x45, 0x44, 0x35, 0x50,
0x45, 0xF3, 0x8C, 0xD0, 0x47, 0x24, 0x17, 0x50, 0x47, 0xDC, 0xA9, 0x50, 0x49, 0x03, 0xF9, 0x50,
0x49, 0xB3, 0x50, 0xD0, 0x4A, 0xE3, 0xDB, 0x50, 0x4B, 0x9C, 0x6D, 0x50, 0x4C, 0xCC, 0xF7, 0xD0,
0x4D, 0x85, 0x89, 0xD0, 0x4E, 0xBF, 0x4E, 0xD0, 0x4F, 0x77, 0xE0, 0xD0, 0x50, 0x95, 0xF6, 0x50,
@@ -7552,8 +7552,8 @@ const unsigned char timelib_timezone_db_data_builtin[261404] = {
/* Asia/Amman */
0x50, 0x48, 0x50, 0x31, 0x01, 0x4A, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11, 0xB6, 0xA3, 0xD6, 0xD0,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0xB6, 0xA3, 0xD6, 0xD0,
0x06, 0x72, 0x79, 0xE0, 0x07, 0x0C, 0xAB, 0x50, 0x08, 0x24, 0x37, 0x60, 0x08, 0xED, 0xDE, 0xD0,
0x0A, 0x05, 0x6A, 0xE0, 0x0A, 0xCF, 0x12, 0x50, 0x0B, 0xE7, 0xEF, 0xE0, 0x0C, 0xDA, 0x75, 0xD0,
0x0D, 0xC9, 0x23, 0x60, 0x0E, 0x92, 0xCA, 0xD0, 0x0F, 0xA9, 0x05, 0x60, 0x10, 0x72, 0xAC, 0xD0,
@@ -7570,17 +7570,31 @@ const unsigned char timelib_timezone_db_data_builtin[261404] = {
0x42, 0x4C, 0x72, 0xE0, 0x43, 0x3C, 0x63, 0xE0, 0x44, 0x2C, 0x54, 0xE0, 0x45, 0x41, 0x2F, 0xE0,
0x46, 0x0C, 0x36, 0xE0, 0x47, 0x21, 0x11, 0xE0, 0x47, 0xEC, 0x18, 0xE0, 0x49, 0x0A, 0x2E, 0x60,
0x49, 0xCB, 0xFA, 0xE0, 0x4A, 0xEA, 0x10, 0x60, 0x4B, 0xAB, 0xDC, 0xE0, 0x4C, 0xC9, 0xF2, 0x60,
-0x4D, 0x94, 0xF9, 0x60, 0x4E, 0xA9, 0xD4, 0x60, 0x4F, 0x74, 0xDB, 0x60, 0x50, 0x89, 0xB6, 0x60,
+0x4D, 0x94, 0xF9, 0x60, 0x4E, 0xA9, 0xD4, 0x60, 0x4F, 0x74, 0xDB, 0x60, 0x52, 0xB3, 0x5E, 0x50,
+0x53, 0x34, 0x9F, 0x60, 0x54, 0x52, 0xB4, 0xE0, 0x55, 0x14, 0x81, 0x60, 0x56, 0x32, 0x96, 0xE0,
+0x56, 0xFD, 0x9D, 0xE0, 0x58, 0x12, 0x78, 0xE0, 0x58, 0xDD, 0x7F, 0xE0, 0x59, 0xF2, 0x5A, 0xE0,
+0x5A, 0xBD, 0x61, 0xE0, 0x5B, 0xD2, 0x3C, 0xE0, 0x5C, 0x9D, 0x43, 0xE0, 0x5D, 0xB2, 0x1E, 0xE0,
+0x5E, 0x7D, 0x25, 0xE0, 0x5F, 0x9B, 0x3B, 0x60, 0x60, 0x5D, 0x07, 0xE0, 0x61, 0x7B, 0x1D, 0x60,
+0x62, 0x46, 0x24, 0x60, 0x63, 0x5A, 0xFF, 0x60, 0x64, 0x26, 0x06, 0x60, 0x65, 0x3A, 0xE1, 0x60,
+0x66, 0x05, 0xE8, 0x60, 0x67, 0x1A, 0xC3, 0x60, 0x67, 0xE5, 0xCA, 0x60, 0x69, 0x03, 0xDF, 0xE0,
+0x69, 0xC5, 0xAC, 0x60, 0x6A, 0xE3, 0xC1, 0xE0, 0x6B, 0xA5, 0x8E, 0x60, 0x6C, 0xC3, 0xA3, 0xE0,
+0x6D, 0x8E, 0xAA, 0xE0, 0x6E, 0xA3, 0x85, 0xE0, 0x6F, 0x6E, 0x8C, 0xE0, 0x70, 0x83, 0x67, 0xE0,
+0x71, 0x4E, 0x6E, 0xE0, 0x72, 0x63, 0x49, 0xE0, 0x73, 0x2E, 0x50, 0xE0, 0x74, 0x4C, 0x66, 0x60,
+0x75, 0x0E, 0x32, 0xE0, 0x76, 0x2C, 0x48, 0x60, 0x76, 0xF7, 0x4F, 0x60, 0x78, 0x0C, 0x2A, 0x60,
+0x78, 0xD7, 0x31, 0x60, 0x79, 0xEC, 0x0C, 0x60, 0x7A, 0xB7, 0x13, 0x60, 0x7B, 0xCB, 0xEE, 0x60,
+0x7C, 0x96, 0xF5, 0x60, 0x7D, 0xB5, 0x0A, 0xE0, 0x7E, 0x76, 0xD7, 0x60, 0x7F, 0x94, 0xEC, 0xE0,
0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
0x02, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x01,
0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01,
-0x03, 0x01, 0x03, 0x01, 0x05, 0x00, 0x00, 0x21, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01,
+0x03, 0x01, 0x03, 0x01, 0x02, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01,
+0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01,
+0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01,
+0x03, 0x01, 0x03, 0x01, 0x03, 0x00, 0x00, 0x21, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01,
0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A,
-0x30, 0x01, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53,
-0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBA, 0x14, 0xB8, 0x01, 0x49, 0x7C, 0xF5, 0x00, 0x00,
-0x00, 0x00,
+0x30, 0x01, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBA, 0x14, 0xB8, 0x01, 0x49,
+0x7C, 0xF5, 0x00, 0x00, 0x00, 0x00,
/* Asia/Anadyr */
0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -11908,7 +11922,7 @@ const unsigned char timelib_timezone_db_data_builtin[261404] = {
0x33, 0x47, 0x2D, 0xD0, 0x34, 0x40, 0x59, 0x50, 0x35, 0x1D, 0xD5, 0x50, 0x36, 0x32, 0xB0, 0x50,
0x36, 0xFD, 0xB7, 0x50, 0x38, 0x1B, 0xCC, 0xD0, 0x38, 0xE6, 0xD3, 0xD0, 0x39, 0xFB, 0xAE, 0xD0,
0x3A, 0xC6, 0xB5, 0xD0, 0x3B, 0xDB, 0x90, 0xD0, 0x3C, 0xAF, 0xD2, 0x50, 0x3D, 0xBB, 0x72, 0xD0,
-0x3E, 0x8F, 0xB4, 0x50, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x6F, 0x96, 0x50, 0x45, 0x44, 0x35, 0x50,
+0x3E, 0x8F, 0xB4, 0x50, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x66, 0x5B, 0xD0, 0x45, 0x44, 0x35, 0x50,
0x45, 0xF3, 0x8C, 0xD0, 0x47, 0x24, 0x17, 0x50, 0x47, 0xDC, 0xA9, 0x50, 0x49, 0x03, 0xF9, 0x50,
0x49, 0xB3, 0x50, 0xD0, 0x4A, 0xE3, 0xDB, 0x50, 0x4B, 0x9C, 0x6D, 0x50, 0x4C, 0xCC, 0xF7, 0xD0,
0x4D, 0x85, 0x89, 0xD0, 0x4E, 0xBF, 0x4E, 0xD0, 0x4F, 0x77, 0xE0, 0xD0, 0x50, 0x95, 0xF6, 0x50,
@@ -18402,4 +18416,4 @@ const unsigned char timelib_timezone_db_data_builtin[261404] = {
0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80,
0x00, 0x00, 0x00, 0x00, };
-const timelib_tzdb timezonedb_builtin = { "2013.8", 579, timezonedb_idx_builtin, timelib_timezone_db_data_builtin };
+const timelib_tzdb timezonedb_builtin = { "2013.9", 579, timezonedb_idx_builtin, timelib_timezone_db_data_builtin };
diff --git a/ext/date/lib/unixtime2tm.c b/ext/date/lib/unixtime2tm.c
index c177feebb..194b3b211 100644
--- a/ext/date/lib/unixtime2tm.c
+++ b/ext/date/lib/unixtime2tm.c
@@ -137,19 +137,16 @@ void timelib_unixtime2gmt(timelib_time* tm, timelib_sll ts)
void timelib_update_from_sse(timelib_time *tm)
{
timelib_sll sse;
+ int z = tm->z;
+ signed int dst = tm->dst;
sse = tm->sse;
switch (tm->zone_type) {
case TIMELIB_ZONETYPE_ABBR:
case TIMELIB_ZONETYPE_OFFSET: {
- int z = tm->z;
- signed int dst = tm->dst;
-
timelib_unixtime2gmt(tm, tm->sse - (tm->z * 60) + (tm->dst * 3600));
- tm->z = z;
- tm->dst = dst;
goto cleanup;
}
@@ -171,6 +168,8 @@ cleanup:
tm->sse = sse;
tm->is_localtime = 1;
tm->have_zone = 1;
+ tm->z = z;
+ tm->dst = dst;
}
void timelib_unixtime2local(timelib_time *tm, timelib_sll ts)
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 13a645117..d96428d5e 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -797,6 +797,14 @@ PHP_RSHUTDOWN_FUNCTION(date)
#define DATE_FORMAT_ISO8601 "Y-m-d\\TH:i:sO"
+/*
+ * This comes from various sources that like to contradict. I'm going with the
+ * format here because of:
+ * http://msdn.microsoft.com/en-us/library/windows/desktop/aa384321%28v=vs.85%29.aspx
+ * and http://curl.haxx.se/rfc/cookie_spec.html
+ */
+#define DATE_FORMAT_COOKIE "l, d-M-Y H:i:s T"
+
#define DATE_TZ_ERRMSG \
"It is not safe to rely on the system's timezone settings. You are " \
"*required* to use the date.timezone setting or the " \
@@ -827,7 +835,7 @@ PHP_MINIT_FUNCTION(date)
* with the variations that the only legal time zone is GMT
* and the separators between the elements of the date must be dashes."
*/
- REGISTER_STRING_CONSTANT("DATE_COOKIE", DATE_FORMAT_RFC850, CONST_CS | CONST_PERSISTENT);
+ REGISTER_STRING_CONSTANT("DATE_COOKIE", DATE_FORMAT_COOKIE, CONST_CS | CONST_PERSISTENT);
REGISTER_STRING_CONSTANT("DATE_ISO8601", DATE_FORMAT_ISO8601, CONST_CS | CONST_PERSISTENT);
REGISTER_STRING_CONSTANT("DATE_RFC822", DATE_FORMAT_RFC822, CONST_CS | CONST_PERSISTENT);
REGISTER_STRING_CONSTANT("DATE_RFC850", DATE_FORMAT_RFC850, CONST_CS | CONST_PERSISTENT);
@@ -1981,12 +1989,25 @@ zend_object_iterator *date_object_period_get_iterator(zend_class_entry *ce, zval
return (zend_object_iterator*)iterator;
}
+static int implement_date_interface_handler(zend_class_entry *interface, zend_class_entry *implementor TSRMLS_DC)
+{
+ if (implementor->type == ZEND_USER_CLASS &&
+ !instanceof_function(implementor, date_ce_date TSRMLS_CC) &&
+ !instanceof_function(implementor, date_ce_immutable TSRMLS_CC)
+ ) {
+ zend_error(E_ERROR, "DateTimeInterface can't be implemented by user classes");
+ }
+
+ return SUCCESS;
+}
+
static void date_register_classes(TSRMLS_D)
{
zend_class_entry ce_date, ce_immutable, ce_timezone, ce_interval, ce_period, ce_interface;
INIT_CLASS_ENTRY(ce_interface, "DateTimeInterface", date_funcs_interface);
date_ce_interface = zend_register_internal_interface(&ce_interface TSRMLS_CC);
+ date_ce_interface->interface_gets_implemented = implement_date_interface_handler;
INIT_CLASS_ENTRY(ce_date, "DateTime", date_funcs_date);
ce_date.create_object = date_object_new_date;
@@ -2002,7 +2023,7 @@ static void date_register_classes(TSRMLS_D)
zend_declare_class_constant_stringl(date_ce_date, const_name, sizeof(const_name)-1, value, sizeof(value)-1 TSRMLS_CC);
REGISTER_DATE_CLASS_CONST_STRING("ATOM", DATE_FORMAT_RFC3339);
- REGISTER_DATE_CLASS_CONST_STRING("COOKIE", DATE_FORMAT_RFC850);
+ REGISTER_DATE_CLASS_CONST_STRING("COOKIE", DATE_FORMAT_COOKIE);
REGISTER_DATE_CLASS_CONST_STRING("ISO8601", DATE_FORMAT_ISO8601);
REGISTER_DATE_CLASS_CONST_STRING("RFC822", DATE_FORMAT_RFC822);
REGISTER_DATE_CLASS_CONST_STRING("RFC850", DATE_FORMAT_RFC850);
@@ -2602,6 +2623,7 @@ PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str,
timelib_fill_holes(dateobj->time, now, TIMELIB_NO_CLONE);
timelib_update_ts(dateobj->time, tzi);
+ timelib_update_from_sse(dateobj->time);
dateobj->time->have_relative = 0;
@@ -3115,33 +3137,16 @@ static void php_date_add(zval *object, zval *interval, zval *return_value TSRMLS
{
php_date_obj *dateobj;
php_interval_obj *intobj;
- int bias = 1;
+ timelib_time *new_time;
dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC);
DATE_CHECK_INITIALIZED(dateobj->time, DateTime);
intobj = (php_interval_obj *) zend_object_store_get_object(interval TSRMLS_CC);
DATE_CHECK_INITIALIZED(intobj->initialized, DateInterval);
- if (intobj->diff->have_weekday_relative || intobj->diff->have_special_relative) {
- memcpy(&dateobj->time->relative, intobj->diff, sizeof(struct timelib_rel_time));
- } else {
- if (intobj->diff->invert) {
- bias = -1;
- }
- memset(&dateobj->time->relative, 0, sizeof(struct timelib_rel_time));
- dateobj->time->relative.y = intobj->diff->y * bias;
- dateobj->time->relative.m = intobj->diff->m * bias;
- dateobj->time->relative.d = intobj->diff->d * bias;
- dateobj->time->relative.h = intobj->diff->h * bias;
- dateobj->time->relative.i = intobj->diff->i * bias;
- dateobj->time->relative.s = intobj->diff->s * bias;
- }
- dateobj->time->have_relative = 1;
- dateobj->time->sse_uptodate = 0;
-
- timelib_update_ts(dateobj->time, NULL);
- timelib_update_from_sse(dateobj->time);
- dateobj->time->have_relative = 0;
+ new_time = timelib_add(dateobj->time, intobj->diff);
+ timelib_time_dtor(dateobj->time);
+ dateobj->time = new_time;
}
/* {{{ proto DateTime date_add(DateTime object, DateInterval interval)
@@ -3182,7 +3187,7 @@ static void php_date_sub(zval *object, zval *interval, zval *return_value TSRMLS
{
php_date_obj *dateobj;
php_interval_obj *intobj;
- int bias = 1;
+ timelib_time *new_time;
dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC);
DATE_CHECK_INITIALIZED(dateobj->time, DateTime);
@@ -3194,24 +3199,9 @@ static void php_date_sub(zval *object, zval *interval, zval *return_value TSRMLS
return;
}
- if (intobj->diff->invert) {
- bias = -1;
- }
-
- memset(&dateobj->time->relative, 0, sizeof(struct timelib_rel_time));
- dateobj->time->relative.y = 0 - (intobj->diff->y * bias);
- dateobj->time->relative.m = 0 - (intobj->diff->m * bias);
- dateobj->time->relative.d = 0 - (intobj->diff->d * bias);
- dateobj->time->relative.h = 0 - (intobj->diff->h * bias);
- dateobj->time->relative.i = 0 - (intobj->diff->i * bias);
- dateobj->time->relative.s = 0 - (intobj->diff->s * bias);
- dateobj->time->have_relative = 1;
- dateobj->time->sse_uptodate = 0;
-
- timelib_update_ts(dateobj->time, NULL);
- timelib_update_from_sse(dateobj->time);
-
- dateobj->time->have_relative = 0;
+ new_time = timelib_sub(dateobj->time, intobj->diff);
+ timelib_time_dtor(dateobj->time);
+ dateobj->time = new_time;
}
/* {{{ proto DateTime date_sub(DateTime object, DateInterval interval)
@@ -3603,13 +3593,13 @@ PHP_FUNCTION(date_diff)
php_interval_obj *interval;
long absolute = 0;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO|l", &object1, date_ce_date, &object2, date_ce_date, &absolute) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO|l", &object1, date_ce_interface, &object2, date_ce_interface, &absolute) == FAILURE) {
RETURN_FALSE;
}
dateobj1 = (php_date_obj *) zend_object_store_get_object(object1 TSRMLS_CC);
dateobj2 = (php_date_obj *) zend_object_store_get_object(object2 TSRMLS_CC);
- DATE_CHECK_INITIALIZED(dateobj1->time, DateTime);
- DATE_CHECK_INITIALIZED(dateobj2->time, DateTime);
+ DATE_CHECK_INITIALIZED(dateobj1->time, DateTimeInterface);
+ DATE_CHECK_INITIALIZED(dateobj2->time, DateTimeInterface);
timelib_update_ts(dateobj1->time, NULL);
timelib_update_ts(dateobj2->time, NULL);
@@ -4387,7 +4377,7 @@ PHP_METHOD(DatePeriod, __construct)
zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "OOl|l", &start, date_ce_interface, &interval, date_ce_interval, &recurrences, &options) == FAILURE) {
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "OOO|l", &start, date_ce_interface, &interval, date_ce_interval, &end, date_ce_date, &options) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "OOO|l", &start, date_ce_interface, &interval, date_ce_interval, &end, date_ce_interface, &options) == FAILURE) {
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &isostr, &isostr_len, &options) == FAILURE) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "This constructor accepts either (DateTimeInterface, DateInterval, int) OR (DateTimeInterface, DateInterval, DateTime) OR (string) as arguments.");
zend_restore_error_handling(&error_handling TSRMLS_CC);
diff --git a/ext/date/tests/DateTime_format_basic2.phpt b/ext/date/tests/DateTime_format_basic2.phpt
index d7adaa5df..016fa7b6b 100644
--- a/ext/date/tests/DateTime_format_basic2.phpt
+++ b/ext/date/tests/DateTime_format_basic2.phpt
@@ -31,7 +31,7 @@ var_dump( $date->format( DateTime::W3C) ) ;
--EXPECT--
*** Testing date_format() : basic functionality - formatting coinstants ***
string(25) "2005-07-14T22:30:41+01:00"
-string(32) "Thursday, 14-Jul-05 22:30:41 BST"
+string(34) "Thursday, 14-Jul-2005 22:30:41 BST"
string(24) "2005-07-14T22:30:41+0100"
string(29) "Thu, 14 Jul 05 22:30:41 +0100"
string(32) "Thursday, 14-Jul-05 22:30:41 BST"
diff --git a/ext/date/tests/DateTime_verify.phpt b/ext/date/tests/DateTime_verify.phpt
index a03911f5c..c79097472 100644
--- a/ext/date/tests/DateTime_verify.phpt
+++ b/ext/date/tests/DateTime_verify.phpt
@@ -160,7 +160,7 @@ array(11) {
["ATOM"]=>
string(13) "Y-m-d\TH:i:sP"
["COOKIE"]=>
- string(16) "l, d-M-y H:i:s T"
+ string(16) "l, d-M-Y H:i:s T"
["ISO8601"]=>
string(13) "Y-m-d\TH:i:sO"
["RFC822"]=>
@@ -180,4 +180,4 @@ array(11) {
["W3C"]=>
string(13) "Y-m-d\TH:i:sP"
}
-===DONE=== \ No newline at end of file
+===DONE===
diff --git a/ext/date/tests/bug52063.phpt b/ext/date/tests/bug52063.phpt
index af9da9e42..7364a8061 100644
--- a/ext/date/tests/bug52063.phpt
+++ b/ext/date/tests/bug52063.phpt
@@ -11,5 +11,5 @@ echo $a->format(DateTime::COOKIE);
echo "\n";
?>
--EXPECTF--
-Thursday, 01-Jan-09 00:00:00 WET
-Thursday, 01-Jan-09 00:00:00 WET
+Thursday, 01-Jan-2009 00:00:00 WET
+Thursday, 01-Jan-2009 00:00:00 WET
diff --git a/ext/date/tests/bug53879.phpt b/ext/date/tests/bug53879.phpt
new file mode 100644
index 000000000..3d16c9720
--- /dev/null
+++ b/ext/date/tests/bug53879.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #53879 (DateTime::createFromFormat() fails to parse cookie expiration date)
+--INI--
+date.timezone=UTC
+--FILE--
+<?php
+$date = DateTime::createFromFormat(DateTime::COOKIE, "Mon, 21-Jan-2041 15:24:52 GMT");
+print_r($date);
+?>
+--EXPECTF--
+DateTime Object
+(
+ [date] => 2041-01-21 15:24:52
+ [timezone_type] => 2
+ [timezone] => GMT
+)
diff --git a/ext/date/tests/bug63391.phpt b/ext/date/tests/bug63391.phpt
new file mode 100644
index 000000000..a29d25e73
--- /dev/null
+++ b/ext/date/tests/bug63391.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Test for #63391 (Incorrect/inconsistent day of week prior to the year 1600)
+--FILE--
+<?php
+ini_set('date.timezone', 'UTC');
+
+print "Date PHP\n";
+print "---------- ---\n";
+$dates = array('1599-12-30', '1599-12-31', '1600-01-01', '1600-01-02');
+foreach ($dates as $date) {
+ echo date_create($date)->format('Y-m-d D'), "\n";
+}
+?>
+--EXPECT--
+Date PHP
+---------- ---
+1599-12-30 Thu
+1599-12-31 Fri
+1600-01-01 Sat
+1600-01-02 Sun
diff --git a/ext/date/tests/date_constants.phpt b/ext/date/tests/date_constants.phpt
index 132e24159..b9fce8c78 100644
--- a/ext/date/tests/date_constants.phpt
+++ b/ext/date/tests/date_constants.phpt
@@ -41,8 +41,8 @@ Date constants
--EXPECT--
string(25) "2006-07-01T14:27:30+02:00"
string(25) "2006-05-30T14:32:13+02:00"
-string(33) "Saturday, 01-Jul-06 14:27:30 CEST"
-string(32) "Tuesday, 30-May-06 14:32:13 CEST"
+string(35) "Saturday, 01-Jul-2006 14:27:30 CEST"
+string(34) "Tuesday, 30-May-2006 14:32:13 CEST"
string(24) "2006-07-01T14:27:30+0200"
string(24) "2006-05-30T14:32:13+0200"
string(29) "Sat, 01 Jul 06 14:27:30 +0200"
diff --git a/ext/date/tests/forward-transition-construction.phpt b/ext/date/tests/forward-transition-construction.phpt
new file mode 100644
index 000000000..8f195a51b
--- /dev/null
+++ b/ext/date/tests/forward-transition-construction.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Test for Date/Time construction during a forward DST transition
+--FILE--
+<?php
+date_default_timezone_set('America/New_York');
+
+$date = new DateTime('2010-03-14 01:30:00');
+echo $date->format('Y-m-d H:i:s T/e - U') . "\n";
+
+$date = new DateTime('2010-03-14 02:00:00');
+echo $date->format('Y-m-d H:i:s T/e - U') . "\n";
+
+$date = new DateTime('2010-03-14 02:30:00');
+echo $date->format('Y-m-d H:i:s T/e - U') . "\n";
+
+$date = new DateTime('2010-03-14 03:00:00');
+echo $date->format('Y-m-d H:i:s T/e - U') . "\n";
+
+$date = new DateTime('2010-03-14 03:30:00');
+echo $date->format('Y-m-d H:i:s T/e - U') . "\n";
+?>
+--EXPECT--
+2010-03-14 01:30:00 EST/America/New_York - 1268548200
+2010-03-14 03:00:00 EDT/America/New_York - 1268550000
+2010-03-14 03:30:00 EDT/America/New_York - 1268551800
+2010-03-14 03:00:00 EDT/America/New_York - 1268550000
+2010-03-14 03:30:00 EDT/America/New_York - 1268551800
diff --git a/ext/date/tests/gmdate_variation13.phpt b/ext/date/tests/gmdate_variation13.phpt
index 5a19ae268..1d1f434ec 100644
--- a/ext/date/tests/gmdate_variation13.phpt
+++ b/ext/date/tests/gmdate_variation13.phpt
@@ -45,7 +45,7 @@ string(25) "2008-08-08T08:08:08+00:00"
string(%d) "%s"
--DATE_COOKIE Constant--
-string(30) "Friday, 08-Aug-08 08:08:08 GMT"
+string(32) "Friday, 08-Aug-2008 08:08:08 GMT"
string(%d) "%s"
--DATE_RFC822 Constant--
@@ -79,4 +79,4 @@ string(%d) "%s"
--DATE_W3C Constant--
string(25) "2008-08-08T08:08:08+00:00"
string(%d) "%s"
-===DONE=== \ No newline at end of file
+===DONE===
diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-ba.phpt b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-ba.phpt
new file mode 100644
index 000000000..fdbe96d7d
--- /dev/null
+++ b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-ba.phpt
@@ -0,0 +1,96 @@
+--TEST--
+RFC: DateTime and Daylight Saving Time Transitions (zone type 3, ba)
+--CREDITS--
+Daniel Convissor <danielc@php.net>
+--FILE--
+<?php
+
+date_default_timezone_set('America/New_York');
+$date_format = 'Y-m-d H:i:s T e';
+$interval_format = 'P%dDT%hH';
+
+/*
+ * Backward Transitions, add().
+ */
+
+$start = new DateTime('2010-11-07 01:59:59');
+$interval_spec = 'PT1S';
+$interval = new DateInterval($interval_spec);
+echo 'ba1 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+
+$start = new DateTime('2010-11-06 04:30:00');
+$interval_spec = 'P1D';
+$interval = new DateInterval($interval_spec);
+echo 'ba2 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+
+$start = new DateTime('2010-11-06 04:30:00');
+$interval_spec = 'PT24H';
+$interval = new DateInterval($interval_spec);
+echo 'ba3 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+
+$start = new DateTime('2010-11-06 04:30:00');
+$interval_spec = 'PT23H';
+$interval = new DateInterval($interval_spec);
+echo 'ba4 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+
+$start = new DateTime('2010-11-06 04:30:00');
+$interval_spec = 'PT22H';
+$interval = new DateInterval($interval_spec);
+echo 'ba5 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+
+$start = new DateTime('2010-11-06 04:30:00');
+$interval_spec = 'PT21H';
+$interval = new DateInterval($interval_spec);
+echo 'ba6 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+
+$start = new DateTime('2010-11-06 01:30:00');
+$interval_spec = 'P1D';
+$interval = new DateInterval($interval_spec);
+echo 'ba7 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+
+$start = new DateTime('2010-11-06 01:30:00');
+$interval_spec = 'P1DT1H';
+$interval = new DateInterval($interval_spec);
+echo 'ba8 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+
+$start = new DateTime('2010-11-06 04:30:00');
+$interval_spec = 'PT25H';
+$interval = new DateInterval($interval_spec);
+echo 'ba9 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+
+$start = new DateTime('2010-11-06 03:30:00');
+$interval_spec = 'P1D';
+$interval = new DateInterval($interval_spec);
+echo 'ba10 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+
+$start = new DateTime('2010-11-06 02:30:00');
+$interval_spec = 'P1D';
+$interval = new DateInterval($interval_spec);
+echo 'ba11 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+
+echo "\n";
+
+?>
+--EXPECT--
+ba1 2010-11-07 01:59:59 EDT America/New_York + PT1S = 2010-11-07 01:00:00 EST America/New_York
+ba2 2010-11-06 04:30:00 EDT America/New_York + P1D = 2010-11-07 04:30:00 EST America/New_York
+ba3 2010-11-06 04:30:00 EDT America/New_York + PT24H = 2010-11-07 03:30:00 EST America/New_York
+ba4 2010-11-06 04:30:00 EDT America/New_York + PT23H = 2010-11-07 02:30:00 EST America/New_York
+ba5 2010-11-06 04:30:00 EDT America/New_York + PT22H = 2010-11-07 01:30:00 EST America/New_York
+ba6 2010-11-06 04:30:00 EDT America/New_York + PT21H = 2010-11-07 01:30:00 EDT America/New_York
+ba7 2010-11-06 01:30:00 EDT America/New_York + P1D = 2010-11-07 01:30:00 EDT America/New_York
+ba8 2010-11-06 01:30:00 EDT America/New_York + P1DT1H = 2010-11-07 02:30:00 EST America/New_York
+ba9 2010-11-06 04:30:00 EDT America/New_York + PT25H = 2010-11-07 04:30:00 EST America/New_York
+ba10 2010-11-06 03:30:00 EDT America/New_York + P1D = 2010-11-07 03:30:00 EST America/New_York
+ba11 2010-11-06 02:30:00 EDT America/New_York + P1D = 2010-11-07 02:30:00 EST America/New_York
diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd1.phpt b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd1.phpt
new file mode 100644
index 000000000..824959993
--- /dev/null
+++ b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd1.phpt
@@ -0,0 +1,48 @@
+--TEST--
+RFC: DateTime and Daylight Saving Time Transitions (zone type 3, bd1)
+--CREDITS--
+Daniel Convissor <danielc@php.net>
+--FILE--
+<?php
+
+date_default_timezone_set('America/New_York');
+$date_format = 'Y-m-d H:i:s T e';
+$interval_format = 'P%dDT%hH';
+
+/*
+ * Backward Transitions, diff().
+ */
+
+$end = new DateTime('2010-11-07 05:30:00');
+$start = new DateTime('2010-11-06 04:30:00');
+echo 'bd1 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
+ . ' = ' . $start->diff($end)->format($interval_format) . "\n";
+
+$end = new DateTime('2010-11-07 04:30:00');
+$start = new DateTime('2010-11-06 04:30:00');
+echo 'bd2 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
+ . ' = ' . $start->diff($end)->format($interval_format) . "\n";
+
+$end = new DateTime('2010-11-07 03:30:00');
+$start = new DateTime('2010-11-06 04:30:00');
+echo 'bd3 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
+ . ' = ' . $start->diff($end)->format($interval_format) . "\n";
+
+$end = new DateTime('2010-11-07 02:30:00');
+$start = new DateTime('2010-11-06 04:30:00');
+echo 'bd4 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
+ . ' = ' . $start->diff($end)->format($interval_format) . "\n";
+
+$end = new DateTime('2010-11-07 01:30:00');
+$start = new DateTime('2010-11-06 01:30:00');
+echo 'bd7 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
+ . ' = ' . $start->diff($end)->format($interval_format) . "\n";
+
+echo "\n";
+?>
+--EXPECT--
+bd1 2010-11-07 05:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P1DT1H
+bd2 2010-11-07 04:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P1DT0H
+bd3 2010-11-07 03:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT24H
+bd4 2010-11-07 02:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT23H
+bd7 2010-11-07 01:30:00 EDT America/New_York - 2010-11-06 01:30:00 EDT America/New_York = P1DT0H
diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd2.phpt b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd2.phpt
new file mode 100644
index 000000000..fe2e79b3b
--- /dev/null
+++ b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd2.phpt
@@ -0,0 +1,56 @@
+--TEST--
+RFC: DateTime and Daylight Saving Time Transitions (zone type 3, bd2)
+--CREDITS--
+Daniel Convissor <danielc@php.net>
+--XFAIL--
+Still not quite right
+--FILE--
+<?php
+
+date_default_timezone_set('America/New_York');
+$date_format = 'Y-m-d H:i:s T e';
+$interval_format = 'P%dDT%hH';
+
+/*
+ * For backward transitions, must create objects with zone type 2
+ * where specifying Daylight or Standard time is required
+ * then converting them to zone type 3.
+ */
+
+$tz = new DateTimeZone('America/New_York');
+
+/*
+ * Backward Transitions, diff().
+ */
+
+$end = new DateTime('2010-11-07 05:30:00');
+$end->setTimeZone($tz);
+$start = new DateTime('2010-11-06 04:30:59');
+echo 'bd0 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
+ . ' = ' . $start->diff($end)->format('P%dDT%hH%iM%sS') . "\n";
+
+$end = new DateTime('2010-11-07 01:30:00 EST');
+$end->setTimeZone($tz);
+$start = new DateTime('2010-11-06 04:30:00');
+echo 'bd5 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
+ . ' = ' . $start->diff($end)->format($interval_format) . "\n";
+
+$end = new DateTime('2010-11-07 01:30:00 EDT');
+$end->setTimeZone($tz);
+$start = new DateTime('2010-11-06 04:30:00');
+echo 'bd6 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
+ . ' = ' . $start->diff($end)->format($interval_format) . "\n";
+
+$end = new DateTime('2010-11-07 01:30:00 EST');
+$end->setTimeZone($tz);
+$start = new DateTime('2010-11-06 01:30:00');
+echo 'bd8 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
+ . ' = ' . $start->diff($end)->format($interval_format) . "\n";
+
+echo "\n";
+?>
+--EXPECT--
+bd0 2010-11-07 01:00:00 EST America/New_York - 2010-11-07 01:59:59 EDT America/New_York = PT0H0M1S
+bd5 2010-11-07 01:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT22H
+bd6 2010-11-07 01:30:00 EDT America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT21H
+bd8 2010-11-07 01:30:00 EST America/New_York - 2010-11-06 01:30:00 EDT America/New_York = P1DT1H
diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bs.phpt b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bs.phpt
new file mode 100644
index 000000000..138c68f3a
--- /dev/null
+++ b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bs.phpt
@@ -0,0 +1,92 @@
+--TEST--
+RFC: DateTime and Daylight Saving Time Transitions (zone type 3, bs)
+--CREDITS--
+Daniel Convissor <danielc@php.net>
+--FILE--
+<?php
+
+date_default_timezone_set('America/New_York');
+$tz = new DateTimeZone('America/New_York');
+$date_format = 'Y-m-d H:i:s T e';
+$interval_format = 'P%dDT%hH';
+
+/*
+ * Backward Transitions, sub().
+ */
+
+$end = new DateTime('2010-11-07 01:00:00 EST');
+$end->setTimeZone($tz);
+$interval_spec = 'PT1S';
+$interval = new DateInterval($interval_spec);
+echo 'bs1 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+
+$end = new DateTime('2010-11-07 04:30:00');
+$interval_spec = 'P1D';
+$interval = new DateInterval($interval_spec);
+echo 'bs2 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+
+$end = new DateTime('2010-11-07 03:30:00');
+$interval_spec = 'PT24H';
+$interval = new DateInterval($interval_spec);
+echo 'bs3 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+
+$end = new DateTime('2010-11-07 02:30:00');
+$interval_spec = 'PT23H';
+$interval = new DateInterval($interval_spec);
+echo 'bs4 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+
+$end = new DateTime('2010-11-07 01:30:00 EST');
+$end->setTimeZone($tz);
+$interval_spec = 'PT22H';
+$interval = new DateInterval($interval_spec);
+echo 'bs5 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+
+$end = new DateTime('2010-11-07 01:30:00 EDT');
+$end->setTimeZone($tz);
+$interval_spec = 'PT21H';
+$interval = new DateInterval($interval_spec);
+echo 'bs6 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+
+$end = new DateTime('2010-11-07 01:30:00');
+$interval_spec = 'P1D';
+$interval = new DateInterval($interval_spec);
+echo 'bs7 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+
+$end = new DateTime('2010-11-07 01:30:00 EST');
+$end->setTimeZone($tz);
+$interval_spec = 'P1DT1H';
+$interval = new DateInterval($interval_spec);
+echo 'bs8 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+
+$end = new DateTime('2010-11-07 03:30:00');
+$interval_spec = 'P1D';
+$interval = new DateInterval($interval_spec);
+echo 'bs9 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+
+$end = new DateTime('2010-11-07 02:30:00');
+$interval_spec = 'P1D';
+$interval = new DateInterval($interval_spec);
+echo 'bs10 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+
+?>
+--EXPECT--
+bs1 2010-11-07 01:00:00 EST America/New_York - PT1S = 2010-11-07 01:59:59 EDT America/New_York
+bs2 2010-11-07 04:30:00 EST America/New_York - P1D = 2010-11-06 04:30:00 EDT America/New_York
+bs3 2010-11-07 03:30:00 EST America/New_York - PT24H = 2010-11-06 04:30:00 EDT America/New_York
+bs4 2010-11-07 02:30:00 EST America/New_York - PT23H = 2010-11-06 04:30:00 EDT America/New_York
+bs5 2010-11-07 01:30:00 EST America/New_York - PT22H = 2010-11-06 04:30:00 EDT America/New_York
+bs6 2010-11-07 01:30:00 EDT America/New_York - PT21H = 2010-11-06 04:30:00 EDT America/New_York
+bs7 2010-11-07 01:30:00 EDT America/New_York - P1D = 2010-11-06 01:30:00 EDT America/New_York
+bs8 2010-11-07 01:30:00 EST America/New_York - P1DT1H = 2010-11-06 00:30:00 EDT America/New_York
+bs9 2010-11-07 03:30:00 EST America/New_York - P1D = 2010-11-06 03:30:00 EDT America/New_York
+bs10 2010-11-07 02:30:00 EST America/New_York - P1D = 2010-11-06 02:30:00 EDT America/New_York
diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fa.phpt b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fa.phpt
new file mode 100644
index 000000000..9fa493f57
--- /dev/null
+++ b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fa.phpt
@@ -0,0 +1,58 @@
+--TEST--
+RFC: DateTime and Daylight Saving Time Transitions (zone type 3, fa)
+--CREDITS--
+Daniel Convissor <danielc@php.net>
+--FILE--
+<?php
+
+date_default_timezone_set('America/New_York');
+$date_format = 'Y-m-d H:i:s T e';
+$interval_format = 'P%dDT%hH';
+
+/*
+ * Forward Transitions, add().
+ */
+
+$start = new DateTime('2010-03-14 01:59:59');
+$interval_spec = 'PT1S';
+$interval = new DateInterval($interval_spec);
+echo 'fa1 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+
+$start = new DateTime('2010-03-13 04:30:00');
+$interval_spec = 'P1D';
+$interval = new DateInterval($interval_spec);
+echo 'fa2 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+
+$start = new DateTime('2010-03-13 04:30:00');
+$interval_spec = 'PT22H';
+$interval = new DateInterval($interval_spec);
+echo 'fa3 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+
+$start = new DateTime('2010-03-13 04:30:00');
+$interval_spec = 'PT21H';
+$interval = new DateInterval($interval_spec);
+echo 'fa4 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+
+$start = new DateTime('2010-03-13 01:30:00');
+$interval_spec = 'P1D';
+$interval = new DateInterval($interval_spec);
+echo 'fa5 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+
+$start = new DateTime('2010-03-13 02:30:00');
+$interval_spec = 'P1D';
+$interval = new DateInterval($interval_spec);
+echo 'fa6 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+?>
+--EXPECT--
+fa1 2010-03-14 01:59:59 EST America/New_York + PT1S = 2010-03-14 03:00:00 EDT America/New_York
+fa2 2010-03-13 04:30:00 EST America/New_York + P1D = 2010-03-14 04:30:00 EDT America/New_York
+fa3 2010-03-13 04:30:00 EST America/New_York + PT22H = 2010-03-14 03:30:00 EDT America/New_York
+fa4 2010-03-13 04:30:00 EST America/New_York + PT21H = 2010-03-14 01:30:00 EST America/New_York
+fa5 2010-03-13 01:30:00 EST America/New_York + P1D = 2010-03-14 01:30:00 EST America/New_York
+fa6 2010-03-13 02:30:00 EST America/New_York + P1D = 2010-03-14 03:30:00 EDT America/New_York
diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fd.phpt b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fd.phpt
new file mode 100644
index 000000000..ae7060be0
--- /dev/null
+++ b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fd.phpt
@@ -0,0 +1,58 @@
+--TEST--
+RFC: DateTime and Daylight Saving Time Transitions (zone type 3, fd)
+--CREDITS--
+Daniel Convissor <danielc@php.net>
+--FILE--
+<?php
+
+date_default_timezone_set('America/New_York');
+$date_format = 'Y-m-d H:i:s T e';
+$interval_format = 'P%dDT%hH';
+
+/*
+ * Forward Transitions, diff().
+ */
+
+$end = new DateTime('2010-03-14 03:00:00');
+$start = new DateTime('2010-03-14 01:59:59');
+echo 'fd1 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
+ . ' = ' . $start->diff($end)->format('PT%hH%iM%sS') . "\n";
+
+$end = new DateTime('2010-03-14 04:30:00');
+$start = new DateTime('2010-03-13 04:30:00');
+echo 'fd2 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
+ . ' = ' . $start->diff($end)->format($interval_format) . "\n";
+
+$end = new DateTime('2010-03-14 03:30:00');
+$start = new DateTime('2010-03-13 04:30:00');
+echo 'fd3 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
+ . ' = ' . $start->diff($end)->format($interval_format) . "\n";
+
+$end = new DateTime('2010-03-14 01:30:00');
+$start = new DateTime('2010-03-13 04:30:00');
+echo 'fd4 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
+ . ' = ' . $start->diff($end)->format($interval_format) . "\n";
+
+$end = new DateTime('2010-03-14 01:30:00');
+$start = new DateTime('2010-03-13 01:30:00');
+echo 'fd5 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
+ . ' = ' . $start->diff($end)->format($interval_format) . "\n";
+
+$end = new DateTime('2010-03-14 03:30:00');
+$start = new DateTime('2010-03-13 03:30:00');
+echo 'fd6 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
+ . ' = ' . $start->diff($end)->format($interval_format) . "\n";
+
+$end = new DateTime('2010-03-14 03:30:00');
+$start = new DateTime('2010-03-13 02:30:00');
+echo 'fd7 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
+ . ' = ' . $start->diff($end)->format($interval_format) . "\n";
+?>
+--EXPECT--
+fd1 2010-03-14 03:00:00 EDT America/New_York - 2010-03-14 01:59:59 EST America/New_York = PT0H0M1S
+fd2 2010-03-14 04:30:00 EDT America/New_York - 2010-03-13 04:30:00 EST America/New_York = P1DT0H
+fd3 2010-03-14 03:30:00 EDT America/New_York - 2010-03-13 04:30:00 EST America/New_York = P0DT22H
+fd4 2010-03-14 01:30:00 EST America/New_York - 2010-03-13 04:30:00 EST America/New_York = P0DT21H
+fd5 2010-03-14 01:30:00 EST America/New_York - 2010-03-13 01:30:00 EST America/New_York = P1DT0H
+fd6 2010-03-14 03:30:00 EDT America/New_York - 2010-03-13 03:30:00 EST America/New_York = P1DT0H
+fd7 2010-03-14 03:30:00 EDT America/New_York - 2010-03-13 02:30:00 EST America/New_York = P1DT1H
diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fs.phpt b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fs.phpt
new file mode 100644
index 000000000..72351d37e
--- /dev/null
+++ b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fs.phpt
@@ -0,0 +1,67 @@
+--TEST--
+RFC: DateTime and Daylight Saving Time Transitions (zone type 3, fs)
+--CREDITS--
+Daniel Convissor <danielc@php.net>
+--XFAIL--
+Still not quite right
+--FILE--
+<?php
+
+date_default_timezone_set('America/New_York');
+$date_format = 'Y-m-d H:i:s T e';
+$interval_format = 'P%dDT%hH';
+
+/*
+ * Forward Transitions, sub().
+ */
+
+$end = new DateTime('2010-03-14 03:00:00');
+$interval_spec = 'PT1S';
+$interval = new DateInterval($interval_spec);
+echo 'fs1 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+
+$end = new DateTime('2010-03-14 04:30:00');
+$interval_spec = 'P1D';
+$interval = new DateInterval($interval_spec);
+echo 'fs2 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+
+$end = new DateTime('2010-03-14 03:30:00');
+$interval_spec = 'PT22H';
+$interval = new DateInterval($interval_spec);
+echo 'fs3 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+
+$end = new DateTime('2010-03-14 01:30:00');
+$interval_spec = 'PT21H';
+$interval = new DateInterval($interval_spec);
+echo 'fs4 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+
+$end = new DateTime('2010-03-14 01:30:00');
+$interval_spec = 'P1D';
+$interval = new DateInterval($interval_spec);
+echo 'fs5 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+
+$end = new DateTime('2010-03-15 03:30:00');
+$interval_spec = 'P1D';
+$interval = new DateInterval($interval_spec);
+echo 'fs6 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+
+$end = new DateTime('2010-03-15 02:30:00');
+$interval_spec = 'P1D';
+$interval = new DateInterval($interval_spec);
+echo 'fs7 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+?>
+--EXPECT--
+fs1 2010-03-14 03:00:00 EDT America/New_York - PT1S = 2010-03-14 01:59:59 EST America/New_York
+fs2 2010-03-14 04:30:00 EDT America/New_York - P1D = 2010-03-13 04:30:00 EST America/New_York
+fs3 2010-03-14 03:30:00 EDT America/New_York - PT22H = 2010-03-13 04:30:00 EST America/New_York
+fs4 2010-03-14 01:30:00 EST America/New_York - PT21H = 2010-03-13 04:30:00 EST America/New_York
+fs5 2010-03-14 01:30:00 EST America/New_York - P1D = 2010-03-13 01:30:00 EST America/New_York
+fs6 2010-03-15 03:30:00 EDT America/New_York - P1D = 2010-03-14 03:30:00 EDT America/New_York
+fs7 2010-03-15 02:30:00 EDT America/New_York - P1D = 2010-03-14 03:30:00 EDT America/New_York
diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3.phpt b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3.phpt
deleted file mode 100644
index 855fe4ef6..000000000
--- a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3.phpt
+++ /dev/null
@@ -1,399 +0,0 @@
---TEST--
-RFC: DateTime and Daylight Saving Time Transitions (zone type 3)
---CREDITS--
-Daniel Convissor <danielc@php.net>
---XFAIL--
-RFC not implemented yet
---FILE--
-<?php
-
-date_default_timezone_set('America/New_York');
-$date_format = 'Y-m-d H:i:s T e';
-$interval_format = 'P%dDT%hH';
-
-/*
- * Forward Transitions, diff().
- */
-
-$end = new DateTime('2010-03-14 03:00:00');
-$start = new DateTime('2010-03-14 01:59:59');
-echo 'fd1 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
- . ' = ' . $start->diff($end)->format('PT%hH%iM%sS') . "\n";
-
-$end = new DateTime('2010-03-14 04:30:00');
-$start = new DateTime('2010-03-13 04:30:00');
-echo 'fd2 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
- . ' = ' . $start->diff($end)->format($interval_format) . "\n";
-
-$end = new DateTime('2010-03-14 03:30:00');
-$start = new DateTime('2010-03-13 04:30:00');
-echo 'fd3 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
- . ' = ' . $start->diff($end)->format($interval_format) . "\n";
-
-$end = new DateTime('2010-03-14 01:30:00');
-$start = new DateTime('2010-03-13 04:30:00');
-echo 'fd4 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
- . ' = ' . $start->diff($end)->format($interval_format) . "\n";
-
-$end = new DateTime('2010-03-14 01:30:00');
-$start = new DateTime('2010-03-13 01:30:00');
-echo 'fd5 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
- . ' = ' . $start->diff($end)->format($interval_format) . "\n";
-
-$end = new DateTime('2010-03-14 03:30:00');
-$start = new DateTime('2010-03-13 03:30:00');
-echo 'fd6 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
- . ' = ' . $start->diff($end)->format($interval_format) . "\n";
-
-$end = new DateTime('2010-03-14 03:30:00');
-$start = new DateTime('2010-03-13 02:30:00');
-echo 'fd7 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
- . ' = ' . $start->diff($end)->format($interval_format) . "\n";
-
-echo "\n";
-
-/*
- * Forward Transitions, add().
- */
-
-$start = new DateTime('2010-03-14 01:59:59');
-$interval_spec = 'PT1S';
-$interval = new DateInterval($interval_spec);
-echo 'fa1 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-$start = new DateTime('2010-03-13 04:30:00');
-$interval_spec = 'P1D';
-$interval = new DateInterval($interval_spec);
-echo 'fa2 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-$start = new DateTime('2010-03-13 04:30:00');
-$interval_spec = 'PT22H';
-$interval = new DateInterval($interval_spec);
-echo 'fa3 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-$start = new DateTime('2010-03-13 04:30:00');
-$interval_spec = 'PT21H';
-$interval = new DateInterval($interval_spec);
-echo 'fa4 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-$start = new DateTime('2010-03-13 01:30:00');
-$interval_spec = 'P1D';
-$interval = new DateInterval($interval_spec);
-echo 'fa5 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-$start = new DateTime('2010-03-13 02:30:00');
-$interval_spec = 'P1D';
-$interval = new DateInterval($interval_spec);
-echo 'fa6 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-echo "\n";
-
-/*
- * Forward Transitions, sub().
- */
-
-$end = new DateTime('2010-03-14 03:00:00');
-$interval_spec = 'PT1S';
-$interval = new DateInterval($interval_spec);
-echo 'fs1 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-$end = new DateTime('2010-03-14 04:30:00');
-$interval_spec = 'P1D';
-$interval = new DateInterval($interval_spec);
-echo 'fs2 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-$end = new DateTime('2010-03-14 03:30:00');
-$interval_spec = 'PT22H';
-$interval = new DateInterval($interval_spec);
-echo 'fs3 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-$end = new DateTime('2010-03-14 01:30:00');
-$interval_spec = 'PT21H';
-$interval = new DateInterval($interval_spec);
-echo 'fs4 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-$end = new DateTime('2010-03-14 01:30:00');
-$interval_spec = 'P1D';
-$interval = new DateInterval($interval_spec);
-echo 'fs5 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-$end = new DateTime('2010-03-15 03:30:00');
-$interval_spec = 'P1D';
-$interval = new DateInterval($interval_spec);
-echo 'fs6 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-$end = new DateTime('2010-03-15 02:30:00');
-$interval_spec = 'P1D';
-$interval = new DateInterval($interval_spec);
-echo 'fs7 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-echo "\n";
-
-
-/*
- * For backward transitions, must create objects with zone type 2
- * where specifying Daylight or Standard time is required
- * then converting them to zone type 3.
- */
-
-$tz = new DateTimeZone('America/New_York');
-
-/*
- * Backward Transitions, diff().
- */
-
-$end = new DateTime('2010-11-07 01:00:00 EST');
-$end->setTimeZone($tz);
-$start = new DateTime('2010-11-07 01:59:59');
-echo 'bd1 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
- . ' = ' . $start->diff($end)->format('PT%hH%iM%sS') . "\n";
-
-$end = new DateTime('2010-11-07 04:30:00');
-$start = new DateTime('2010-11-06 04:30:00');
-echo 'bd2 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
- . ' = ' . $start->diff($end)->format($interval_format) . "\n";
-
-$end = new DateTime('2010-11-07 03:30:00');
-$start = new DateTime('2010-11-06 04:30:00');
-echo 'bd3 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
- . ' = ' . $start->diff($end)->format($interval_format) . "\n";
-
-$end = new DateTime('2010-11-07 02:30:00');
-$start = new DateTime('2010-11-06 04:30:00');
-echo 'bd4 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
- . ' = ' . $start->diff($end)->format($interval_format) . "\n";
-
-$end = new DateTime('2010-11-07 01:30:00 EST');
-$end->setTimeZone($tz);
-$start = new DateTime('2010-11-06 04:30:00');
-echo 'bd5 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
- . ' = ' . $start->diff($end)->format($interval_format) . "\n";
-
-$end = new DateTime('2010-11-07 01:30:00 EDT');
-$end->setTimeZone($tz);
-$start = new DateTime('2010-11-06 04:30:00');
-echo 'bd6 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
- . ' = ' . $start->diff($end)->format($interval_format) . "\n";
-
-$end = new DateTime('2010-11-07 01:30:00');
-$start = new DateTime('2010-11-06 01:30:00');
-echo 'bd7 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
- . ' = ' . $start->diff($end)->format($interval_format) . "\n";
-
-$end = new DateTime('2010-11-07 01:30:00 EST');
-$end->setTimeZone($tz);
-$start = new DateTime('2010-11-06 01:30:00');
-echo 'bd8 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
- . ' = ' . $start->diff($end)->format($interval_format) . "\n";
-
-echo "\n";
-
-/*
- * Backward Transitions, add().
- */
-
-$start = new DateTime('2010-11-07 01:59:59');
-$interval_spec = 'PT1S';
-$interval = new DateInterval($interval_spec);
-echo 'ba1 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-$start = new DateTime('2010-11-06 04:30:00');
-$interval_spec = 'P1D';
-$interval = new DateInterval($interval_spec);
-echo 'ba2 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-$start = new DateTime('2010-11-06 04:30:00');
-$interval_spec = 'PT24H';
-$interval = new DateInterval($interval_spec);
-echo 'ba3 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-$start = new DateTime('2010-11-06 04:30:00');
-$interval_spec = 'PT23H';
-$interval = new DateInterval($interval_spec);
-echo 'ba4 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-$start = new DateTime('2010-11-06 04:30:00');
-$interval_spec = 'PT22H';
-$interval = new DateInterval($interval_spec);
-echo 'ba5 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-$start = new DateTime('2010-11-06 04:30:00');
-$interval_spec = 'PT21H';
-$interval = new DateInterval($interval_spec);
-echo 'ba6 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-$start = new DateTime('2010-11-06 01:30:00');
-$interval_spec = 'P1D';
-$interval = new DateInterval($interval_spec);
-echo 'ba7 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-$start = new DateTime('2010-11-06 01:30:00');
-$interval_spec = 'P1DT1H';
-$interval = new DateInterval($interval_spec);
-echo 'ba8 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-$start = new DateTime('2010-11-06 04:30:00');
-$interval_spec = 'PT25H';
-$interval = new DateInterval($interval_spec);
-echo 'ba9 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-$start = new DateTime('2010-11-06 03:30:00');
-$interval_spec = 'P1D';
-$interval = new DateInterval($interval_spec);
-echo 'ba10 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-$start = new DateTime('2010-11-06 02:30:00');
-$interval_spec = 'P1D';
-$interval = new DateInterval($interval_spec);
-echo 'ba11 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-echo "\n";
-
-/*
- * Backward Transitions, sub().
- */
-
-$end = new DateTime('2010-11-07 01:00:00 EST');
-$end->setTimeZone($tz);
-$interval_spec = 'PT1S';
-$interval = new DateInterval($interval_spec);
-echo 'bs1 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-$end = new DateTime('2010-11-07 04:30:00');
-$interval_spec = 'P1D';
-$interval = new DateInterval($interval_spec);
-echo 'bs2 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-$end = new DateTime('2010-11-07 03:30:00');
-$interval_spec = 'PT24H';
-$interval = new DateInterval($interval_spec);
-echo 'bs3 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-$end = new DateTime('2010-11-07 02:30:00');
-$interval_spec = 'PT23H';
-$interval = new DateInterval($interval_spec);
-echo 'bs4 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-$end = new DateTime('2010-11-07 01:30:00 EST');
-$end->setTimeZone($tz);
-$interval_spec = 'PT22H';
-$interval = new DateInterval($interval_spec);
-echo 'bs5 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-$end = new DateTime('2010-11-07 01:30:00 EDT');
-$end->setTimeZone($tz);
-$interval_spec = 'PT21H';
-$interval = new DateInterval($interval_spec);
-echo 'bs6 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-$end = new DateTime('2010-11-07 01:30:00');
-$interval_spec = 'P1D';
-$interval = new DateInterval($interval_spec);
-echo 'bs7 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-$end = new DateTime('2010-11-07 01:30:00 EST');
-$end->setTimeZone($tz);
-$interval_spec = 'P1DT1H';
-$interval = new DateInterval($interval_spec);
-echo 'bs8 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-$end = new DateTime('2010-11-07 03:30:00');
-$interval_spec = 'P1D';
-$interval = new DateInterval($interval_spec);
-echo 'bs9 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-$end = new DateTime('2010-11-07 02:30:00');
-$interval_spec = 'P1D';
-$interval = new DateInterval($interval_spec);
-echo 'bs10 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-?>
---EXPECT--
-fd1 2010-03-14 03:00:00 EDT America/New_York - 2010-03-14 01:59:59 EST America/New_York = PT0H0M1S
-fd2 2010-03-14 04:30:00 EDT America/New_York - 2010-03-13 04:30:00 EST America/New_York = P1DT0H
-fd3 2010-03-14 03:30:00 EDT America/New_York - 2010-03-13 04:30:00 EST America/New_York = P0DT22H
-fd4 2010-03-14 01:30:00 EST America/New_York - 2010-03-13 04:30:00 EST America/New_York = P0DT21H
-fd5 2010-03-14 01:30:00 EST America/New_York - 2010-03-13 01:30:00 EST America/New_York = P1DT0H
-fd6 2010-03-14 03:30:00 EDT America/New_York - 2010-03-13 03:30:00 EST America/New_York = P1DT0H
-fd7 2010-03-14 03:30:00 EDT America/New_York - 2010-03-13 02:30:00 EST America/New_York = P1DT1H
-
-fa1 2010-03-14 01:59:59 EST America/New_York + PT1S = 2010-03-14 03:00:00 EDT America/New_York
-fa2 2010-03-13 04:30:00 EST America/New_York + P1D = 2010-03-14 04:30:00 EDT America/New_York
-fa3 2010-03-13 04:30:00 EST America/New_York + PT22H = 2010-03-14 03:30:00 EDT America/New_York
-fa4 2010-03-13 04:30:00 EST America/New_York + PT21H = 2010-03-14 01:30:00 EST America/New_York
-fa5 2010-03-13 01:30:00 EST America/New_York + P1D = 2010-03-14 01:30:00 EST America/New_York
-fa6 2010-03-13 02:30:00 EST America/New_York + P1D = 2010-03-14 03:30:00 EDT America/New_York
-
-fs1 2010-03-14 03:00:00 EDT America/New_York - PT1S = 2010-03-14 01:59:59 EST America/New_York
-fs2 2010-03-14 04:30:00 EDT America/New_York - P1D = 2010-03-13 04:30:00 EST America/New_York
-fs3 2010-03-14 03:30:00 EDT America/New_York - PT22H = 2010-03-13 04:30:00 EST America/New_York
-fs4 2010-03-14 01:30:00 EST America/New_York - PT21H = 2010-03-13 04:30:00 EST America/New_York
-fs5 2010-03-14 01:30:00 EST America/New_York - P1D = 2010-03-13 01:30:00 EST America/New_York
-fs6 2010-03-15 03:30:00 EDT America/New_York - P1D = 2010-03-14 03:30:00 EDT America/New_York
-fs7 2010-03-15 03:30:00 EDT America/New_York - P1D = 2010-03-14 03:30:00 EDT America/New_York
-
-bd1 2010-11-07 01:00:00 EST America/New_York - 2010-11-07 01:59:59 EDT America/New_York = PT0H0M1S
-bd2 2010-11-07 04:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P1DT0H
-bd3 2010-11-07 03:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT24H
-bd4 2010-11-07 02:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT23H
-bd5 2010-11-07 01:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT22H
-bd6 2010-11-07 01:30:00 EDT America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT21H
-bd7 2010-11-07 01:30:00 EDT America/New_York - 2010-11-06 01:30:00 EDT America/New_York = P1DT0H
-bd8 2010-11-07 01:30:00 EST America/New_York - 2010-11-06 01:30:00 EDT America/New_York = P1DT1H
-
-ba1 2010-11-07 01:59:59 EDT America/New_York + PT1S = 2010-11-07 01:00:00 EST America/New_York
-ba2 2010-11-06 04:30:00 EDT America/New_York + P1D = 2010-11-07 04:30:00 EST America/New_York
-ba3 2010-11-06 04:30:00 EDT America/New_York + PT24H = 2010-11-07 03:30:00 EST America/New_York
-ba4 2010-11-06 04:30:00 EDT America/New_York + PT23H = 2010-11-07 02:30:00 EST America/New_York
-ba5 2010-11-06 04:30:00 EDT America/New_York + PT22H = 2010-11-07 01:30:00 EST America/New_York
-ba6 2010-11-06 04:30:00 EDT America/New_York + PT21H = 2010-11-07 01:30:00 EDT America/New_York
-ba7 2010-11-06 01:30:00 EDT America/New_York + P1D = 2010-11-07 01:30:00 EDT America/New_York
-ba8 2010-11-06 01:30:00 EDT America/New_York + P1DT1H = 2010-11-07 01:30:00 EST America/New_York
-ba9 2010-11-06 04:30:00 EDT America/New_York + PT25H = 2010-11-07 04:30:00 EST America/New_York
-ba10 2010-11-06 03:30:00 EDT America/New_York + P1D = 2010-11-07 03:30:00 EST America/New_York
-ba11 2010-11-06 02:30:00 EDT America/New_York + P1D = 2010-11-07 02:30:00 EST America/New_York
-
-bs1 2010-11-07 01:00:00 EST America/New_York - PT1S = 2010-11-07 01:59:59 EDT America/New_York
-bs2 2010-11-07 04:30:00 EST America/New_York - P1D = 2010-11-06 04:30:00 EDT America/New_York
-bs3 2010-11-07 03:30:00 EST America/New_York - PT24H = 2010-11-06 04:30:00 EDT America/New_York
-bs4 2010-11-07 02:30:00 EST America/New_York - PT23H = 2010-11-06 04:30:00 EDT America/New_York
-bs5 2010-11-07 01:30:00 EST America/New_York - PT22H = 2010-11-06 04:30:00 EDT America/New_York
-bs6 2010-11-07 01:30:00 EDT America/New_York - PT21H = 2010-11-06 04:30:00 EDT America/New_York
-bs7 2010-11-07 01:30:00 EDT America/New_York - P1D = 2010-11-06 01:30:00 EDT America/New_York
-bs8 2010-11-07 01:30:00 EST America/New_York - P1DT1H = 2010-11-06 00:30:00 EDT America/New_York
-bs9 2010-11-07 03:30:00 EST America/New_York - P1D = 2010-11-06 03:30:00 EDT America/New_York
-bs10 2010-11-07 02:30:00 EST America/New_York - P1D = 2010-11-06 02:30:00 EDT America/New_York
diff --git a/ext/date/tests/strtotime3-64bit.phpt b/ext/date/tests/strtotime3-64bit.phpt
index 7dc081635..3a47659f8 100644
--- a/ext/date/tests/strtotime3-64bit.phpt
+++ b/ext/date/tests/strtotime3-64bit.phpt
@@ -53,7 +53,7 @@ bool(false)
string(31) "Fri, 16 Jun 2006 23:49:12 +0100"
bool(false)
string(31) "Fri, 16 Jun 2006 02:22:00 +0100"
-string(31) "Mon, 16 Jun 0222 02:22:00 -0036"
+string(31) "Sun, 16 Jun 0222 02:22:00 -0036"
string(31) "Fri, 16 Jun 2006 02:22:33 +0100"
bool(false)
string(31) "Tue, 02 Mar 2004 00:00:00 +0000"
diff --git a/ext/date/tests/test-parse-from-format.phpt b/ext/date/tests/test-parse-from-format.phpt
index 2bf9c4e1b..5bb5fe532 100644
--- a/ext/date/tests/test-parse-from-format.phpt
+++ b/ext/date/tests/test-parse-from-format.phpt
@@ -32,8 +32,8 @@ object(DateTime)#2 (3) {
string(6) "+02:00"
}
-string(16) "l, d-M-y H:i:s T"
-string(36) "Tuesday, 08-Jul-08 22:14:12 GMT+0200"
+string(16) "l, d-M-Y H:i:s T"
+string(38) "Tuesday, 08-Jul-2008 22:14:12 GMT+0200"
object(DateTime)#1 (3) {
["date"]=>
string(19) "2008-07-08 22:14:12"