/php-src/ext/date/tests/ |
H A D | bug75577.phpt | 2 Test for bug #75577: DateTime::createFromFormat does not accept 'v' format specifier 7 $d = new DateTime("2018-10-09 09:56:45.412000"); 8 var_dump($s = $d->format(DateTime::RFC3339_EXTENDED)); 10 $d2 = DateTime::createFromFormat(DateTime::RFC3339_EXTENDED, $s); 15 object(DateTime)#%d (3) {
|
H A D | gh7758.phpt | 8 $date = new DateTime('@' . $ts); 13 DateTime Object 19 DateTime Object 25 DateTime Object 31 DateTime Object 37 DateTime Object
|
H A D | getSetMicroseconds.phpt | 2 Tests for DateTime[Immutable]::[get|set]Microseconds 6 class MyDateTime extends DateTime {}; 16 $dt = new DateTime('2023-04-05T06:07:08.901234+00:00'); 70 DateTime::getMicrosecond(): 901234 71 object(DateTime)#%d (3) { 107 DateTime::setMicrosecond(0): object(DateTime)#%d (3) { 115 DateTime::getMicrosecond(): 0 144 DateTime::setMicrosecond(999999): object(DateTime)#%d (3) { 152 DateTime::getMicrosecond(): 999999 182 DateTime::getMicrosecond(): 999999 [all …]
|
H A D | bug55397.phpt | 2 Bug #55397 (comparison of incomplete DateTime causes SIGSEGV) 6 var_dump(unserialize('O:8:"DateTime":0:{}') == new DateTime); 9 Fatal error: Uncaught Error: Invalid serialization data for DateTime object in %sbug55397.php:%d 11 #0 [internal function]: DateTime->__unserialize(Array) 12 #1 %sbug55397.php(%d): unserialize('O:8:"DateTime":...')
|
H A D | bug71826.phpt | 2 Bug #71826 (DateTime::diff confuse on timezone 'Asia/Tokyo') 8 $a = (new DateTime('2015-2-1'))->diff(new DateTime('2015-3-1')); 12 $b = (new DateTime('2015-3-1'))->diff(new DateTime('2015-3-29')); 16 $c = (new DateTime('2015-4-1'))->diff(new DateTime('2015-4-29'));
|
H A D | bug75232.phpt | 2 Bug #75232: print_r of DateTime creating side-effect 8 $d1 = DateTime::createFromFormat("Ymd\THis\Z", '20170920T091600Z'); 11 $d2 = DateTime::createFromFormat("Ymd\THis\Z", '20170920T091600Z'); 17 Warning: Undefined property: DateTime::$date in %s on line %d 19 DateTime Object 26 Warning: Undefined property: DateTime::$date in %s on line %d
|
H A D | test-parse-from-format.phpt | 28 object(DateTime)#2 (3) { 39 object(DateTime)#1 (3) { 50 object(DateTime)#3 (3) { 61 object(DateTime)#2 (3) { 72 object(DateTime)#1 (3) { 83 object(DateTime)#3 (3) { 94 object(DateTime)#2 (3) { 105 object(DateTime)#1 (3) { 116 object(DateTime)#3 (3) { 127 object(DateTime)#2 (3) { [all …]
|
H A D | bug54340.phpt | 2 Bug #54340 (DateTime::add() method bug) 9 $dt = new DateTime('first day of January 2011'); 15 $dt = new DateTime('first day of January 2011'); 21 object(DateTime)#2 (3) { 29 object(DateTime)#2 (3) { 37 object(DateTime)#3 (3) {
|
H A D | gh-124.phpt | 12 var_dump((new DateTime("@-9223372036854775808"))->getTimestamp()); 13 var_dump((new DateTime('-292277022657-01-27 08:29:52 UTC'))->getTimestamp()); 14 var_dump((new DateTime('-292277022657-01-27 08:29:53 UTC'))->getTimestamp()); 16 var_dump((new DateTime("@9223372036854775807"))->getTimestamp()); 17 var_dump((new DateTime('+292277026596-12-04 15:30:07 UTC'))->getTimestamp()); 18 echo (new DateTime('+2512370164-01-01 00:00:00Z'))->format(DATE_RFC3339_EXTENDED);
|
H A D | bug42910.phpt | 2 Bug #42910 (Constructing DateTime with TimeZone Indicator invalidates DateTimeZone) 6 $foo = new DateTime('2007-03-11'); 7 $bar = new DateTime('2007-03-11T00:00:00-0800'); 9 …print $foo->format(DateTime::ISO8601) . ' - ' . $foo->getTimezone()->getName() . ' - ' . $foo->fo… 10 …print $bar->format(DateTime::ISO8601) . ' - ' . $bar->getTimezone()->getName() . ' - ' . $bar->fo… 15 …print $foo->format(DateTime::ISO8601) . ' - ' . $foo->getTimezone()->getName() . ' - ' . $foo->fo… 16 …print $bar->format(DateTime::ISO8601) . ' - ' . $bar->getTimezone()->getName() . ' - ' . $bar->fo…
|
H A D | gh9891.phpt | 2 Bug GH-9891 (DateTime modify with unixtimestamp (@) must work like setTimestamp) 5 $m = new DateTime('2022-12-20 14:30:25', new DateTimeZone('Europe/Paris')); 11 $a = new DateTime('2022-11-01 13:30:00', new DateTimezone('America/Lima')); 13 echo '$a: ', $a->format(DateTime::ATOM), "\n"; 14 echo '$b: ', $b->format(DateTime::ATOM), "\n"; 19 echo '$a: ', $a->format(DateTime::ATOM), "\n"; 20 echo '$b: ', $b->format(DateTime::ATOM), "\n";
|
H A D | bug79452.phpt | 2 Bug #79452 (DateTime::diff() generates months differently between time zones) 7 $from = new DateTime('2019-06-01'); 8 $to = new DateTime('2019-10-01'); 14 $from = new DateTime('2019-06-01'); 15 $to = new DateTime('2019-10-01');
|
H A D | bug55407.phpt | 2 Bug #55407 (Impossible to prototype DateTime::createFromFormat) 8 class DateTime extends \DateTime { 9 …static function createFromFormat($format, $time, ?\DateTimeZone $timezone = null): DateTime|false { 10 return new DateTime(parent::createFromFormat($format, $time, $timezone));
|
H A D | DateTime_serialization.phpt | 2 Test DateTime::__serialize and DateTime::__unserialize 8 $d = new DateTime("2022-04-14 11:27:42"); 24 $d = new DateTime; 55 object(DateTime)#%d (%d) { 66 string(125) "O:8:"DateTime":3:{s:4:"date";s:26:"2022-04-14 11:27:42.000000";s:13:"timezone_type";i:… 70 object(DateTime)#%d (%d) { 92 object(DateTime)#%d (%d) { 103 object(DateTime)#%d (%d) { 111 object(DateTime)#%d (%d) {
|
H A D | DateTime_createFromImmutable-001.phpt | 2 Tests for DateTime::createFromImmutable 10 $m = DateTime::createFromImmutable( $i ); 18 DateTime::createFromImmutable( date_create( $current ) ); 24 object(DateTime)#%d (3) { 33 TypeError: DateTime::createFromImmutable(): Argument #1 ($object) must be of type DateTimeImmutable…
|
H A D | bug76032.phpt | 2 Bug #76032 (DateTime->diff having issues with leap days for timezones ahead of UTC) 8 $d = new DateTime('2008-03-01'); 9 $a = new DateTime('2018-03-01'); 15 $d = new DateTime('2008-03-01'); 16 $a = new DateTime('2018-03-01');
|
H A D | DateTime_fix_createFromFormat.phpt | 2 Test fix for DateTime when date have textual day with dot or other special char at end 9 echo "*** Testing clone on DateTime objects ***\n"; 11 // Create a DateTime object.. 12 $orig = new DateTime('2012-11-29 17:00:00'); 17 // Create a DateTime object from format 18 $fromFormat = DateTime::createFromFormat( "D., M# j, Y g:iA", $string ); 25 *** Testing clone on DateTime objects ***
|
H A D | bug54316.phpt | 2 Bug #54316 (DateTime::createFromFormat does not handle trailing '|' correctly) 7 $dt = DateTime::createFromFormat('Y-m-d|', '2011-02-02'); 10 $dt = DateTime::createFromFormat('Y-m-d!', '2011-02-02'); 14 object(DateTime)#1 (3) { 22 object(DateTime)#2 (3) {
|
H A D | bug73858.phpt | 6 In the "verbose setup method" I'm trying setup the DateTime object myself 7 to see if it's the format string which is parsed in correctly or if it's the DateTime 13 $s = new DateTime($ss); 14 $e = new DateTime($es); 18 $s = (new DateTime("now"))->setTimestamp(strtotime($ss)); // verbose setup method 19 $e = (new DateTime("now"))->setTimestamp(strtotime($es)); // verbose setup method 28 $e = new DateTime($es); 32 $s = new DateTime($ss); 41 $s = new DateTime($ss); 52 $s = new DateTime($ss); [all …]
|
H A D | rfc-datetime_and_daylight_saving_time-type3-bd2.phpt | 2 RFC: DateTime and Daylight Saving Time Transitions (zone type 3, bd2) 24 $end = new DateTime('2010-11-07 01:00:00 EST'); 26 $start = new DateTime('2010-11-07 01:59:59'); 30 $end = new DateTime('2010-11-07 01:30:00 EST'); 32 $start = new DateTime('2010-11-06 04:30:00'); 36 $end = new DateTime('2010-11-07 01:30:00 EDT'); 38 $start = new DateTime('2010-11-06 04:30:00'); 42 $end = new DateTime('2010-11-07 01:00:00 EST'); 44 $start = new DateTime('2010-11-06 01:00:00'); 48 $end = new DateTime('2010-11-07 01:00:00 EDT'); [all …]
|
H A D | DateTime_getOffset_basic1.phpt | 2 Test DateTime::getOffset() function : basic functionality 8 echo "*** Testing DateTime::getOffset() : basic functionality ***\n"; 10 $winter = new DateTime('2008-12-25 14:25:41'); 11 $summer = new DateTime('2008-07-02 14:25:41'); 18 *** Testing DateTime::getOffset() : basic functionality ***
|
H A D | DateTime_compare.phpt | 2 DateTime/DateTimeImmutable compare handler 5 class MyDateTime extends DateTime 12 $DT = new DateTime("2023-01-16 17:09:08"); 45 DateObjectError: Trying to compare an incomplete DateTime or DateTimeImmutable object 46 DateObjectError: Trying to compare an incomplete DateTime or DateTimeImmutable object 47 DateObjectError: Trying to compare an incomplete DateTime or DateTimeImmutable object 48 DateObjectError: Trying to compare an incomplete DateTime or DateTimeImmutable object
|
H A D | bug40743.phpt | 2 Bug #40743 (DateTime ignores the TimeZone object passed to the constructor) 5 $dt = new DateTime('@1200506699', new DateTimeZone('Europe/Berlin')); 12 $dt = new DateTime('16 Jan 08 13:04:59'); 15 $dt = new DateTime('@1200506699'); 18 $dt = new DateTime('@1200506699'); 22 $dt = new DateTime('@1200506699', new DateTimeZone('Europe/Berlin')); 25 $dt = new DateTime('16 Jan 08 13:04:59 America/Chicago'); 28 $dt = new DateTime('16 Jan 08 13:04:59 America/Chicago', new DateTimeZone('Europe/Berlin'));
|
/php-src/ext/date/ |
H A D | php_date.stub.php | 183 function date_modify(DateTime $object, string $modifier): DateTime|false {} 185 function date_add(DateTime $object, DateInterval $interval): DateTime {} 187 function date_sub(DateTime $object, DateInterval $interval): DateTime {} 192 function date_timezone_set(DateTime $object, DateTimeZone $timezone): DateTime {} 201 DateTime $object, int $hour, int $minute, int $second = 0, int $microsecond = 0): DateTime {} 203 function date_date_set(DateTime $object, int $year, int $month, int $day): DateTime {} 205 function date_isodate_set(DateTime $object, int $year, int $week, int $dayOfWeek = 1): DateTime {} 207 function date_timestamp_set(DateTime $object, int $timestamp): DateTime {} 341 class DateTime implements DateTimeInterface class 392 public function add(DateInterval $interval): DateTime {} [all …]
|
/php-src/Zend/tests/parameter_default_values/ |
H A D | internal_declaration_error_null.phpt | 5 class MyDateTime extends DateTime 7 public static function createFromFormat(): DateTime|false 13 …at(): DateTime|false must be compatible with DateTime::createFromFormat(string $format, string $da…
|