php-src/ext/date/tests/date_modify-1.phpt
Derick Rethans e6c1ff254d - Fixed bug #33578 (strtotime() problem with "Oct17" format).
- Fixed problems with lone years in strtotime().
- Added functions to timelib to get a list of all abbreviations and timezone
  identifiers.
- Fixed problems with parsed dates that only have GMT offsets associated
  with them.
- Fixed a Windows compile problem.
- Added special constants for different often used date formats (DATE_ISO8601,
  DATE_RFC822, DATE_RSS etc).
- Fixed date_default_timezone_get() to return the guessed timezone if none
  was set yet with date_default_timezone_set().
- Added experimental support for Date/Timezone objects as per specifications.
2005-07-20 08:31:02 +00:00

31 lines
894 B
PHP

--TEST--
date_modify() function [1]
--SKIPIF--
<?php if (!function_exists('date_create')) echo "SKIP"; ?>
--FILE--
<?php
date_default_timezone_set("Pacific/Kwajalein");
$ts = date_create("Thu Aug 19 1993 23:59:59");
echo date_format($ts, DATE_RFC822), "\n";
$ts->modify("+1 second");
echo date_format($ts, DATE_RFC822), "\n";
date_default_timezone_set("Europe/Amsterdam");
$ts = date_create("Sun Mar 27 01:59:59 2005");
echo date_format($ts, DATE_RFC822), "\n";
$ts->modify("+1 second");
echo date_format($ts, DATE_RFC822), "\n";
$ts = date_create("Sun Oct 30 01:59:59 2005");
echo date_format($ts, DATE_RFC822), "\n";
$ts->modify("+ 1 hour 1 second");
echo date_format($ts, DATE_RFC822), "\n";
?>
--EXPECT--
Thu, 19 Aug 1993 23:59:59 KWAT
Sat, 21 Aug 1993 00:00:00 MHT
Sun, 27 Mar 2005 01:59:59 CET
Sun, 27 Mar 2005 03:00:00 CEST
Sun, 30 Oct 2005 01:59:59 CEST
Sun, 30 Oct 2005 03:00:00 CET