From fcc22c6af34d0072583b51951ae4930883e19832 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Mon, 30 Aug 2010 16:25:52 +0000 Subject: [PATCH] - Fixed bug #52454 (Relative dates and getTimestamp increments by one day) --- ext/date/lib/tm2unixtime.c | 1 + ext/date/tests/bug52454.phpt | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 ext/date/tests/bug52454.phpt diff --git a/ext/date/lib/tm2unixtime.c b/ext/date/lib/tm2unixtime.c index 59f7daf9fb..f2b7493ed4 100644 --- a/ext/date/lib/tm2unixtime.c +++ b/ext/date/lib/tm2unixtime.c @@ -444,6 +444,7 @@ void timelib_update_ts(timelib_time* time, timelib_tzinfo* tzi) time->sse = res; time->sse_uptodate = 1; + time->have_relative = time->relative.have_weekday_relative = time->relative.have_special_relative = 0; } #if 0 diff --git a/ext/date/tests/bug52454.phpt b/ext/date/tests/bug52454.phpt new file mode 100644 index 0000000000..e2a94dc5bc --- /dev/null +++ b/ext/date/tests/bug52454.phpt @@ -0,0 +1,22 @@ +--TEST-- +Bug #52454 (Relative dates and getTimestamp increments by one day) +--FILE-- +modify('this week +6 days'); + +echo $endOfWeek->format('Y-m-d H:i:s')."\n"; +echo $endOfWeek->format('U')."\n"; + +/* Thar she blows! */ +echo $endOfWeek->getTimestamp()."\n"; + +echo $endOfWeek->format('Y-m-d H:i:s')."\n"; +?> +--EXPECT-- +2010-08-01 09:46:49 +1280652409 +1280652409 +2010-08-01 09:46:49 -- 2.40.0