xref: /PHP-8.4/ext/date/tests/bug54597.phpt (revision 109cc0bf)
1--TEST--
2Bug #54597 (incorrect years for DateTime objects created with 4-digit years)
3--INI--
4date.timezone=Europe/London
5--FILE--
6<?php
7$tz = new DateTimeZone("Europe/Amsterdam");
8$dateObject = new DateTime( 'January 0099', $tz );
9echo $dateObject->format( 'Y' ), "\n";
10$dateObject = new DateTime( 'January 1, 0099', $tz );
11echo $dateObject->format( 'Y' ), "\n";
12$dateObject = new DateTime( '0099-01', $tz );
13echo $dateObject->format( 'Y' ), "\n";
14?>
15--EXPECT--
160099
170099
180099
19