php-src/ext/date/tests/bug45554.phpt
Derick Rethans a2ad4ea8b5 - Change this test case because non-6 digits are supported now, and clarify
that the "1" doesn't show because the precision isn't high enough. (Same
  happens if you change it to 9).
2010-03-07 13:47:06 +00:00

21 lines
645 B
PHP

--TEST--
Bug #45554 (Inconsistent behavior of the u format char)
--INI--
date.timezone=UTC
--FILE--
<?php
$format = "m-d-Y H:i:s.u T";
$d = date_create_from_format($format, "03-15-2005 12:22:29.000000 PST");
echo $d->format($format), "\n";
$d = date_create_from_format($format, "03-15-2005 12:22:29.001001 PST");
echo $d->format($format), " (precision isn't enough to show the 1 here)\n";
$d = date_create_from_format($format, "03-15-2005 12:22:29.0010 PST");
echo $d->format($format), "\n";
?>
--EXPECT--
03-15-2005 12:22:29.000000 PST
03-15-2005 12:22:29.001000 PST (precision isn't enough to show the 1 here)
03-15-2005 12:22:29.001000 PST