ID:               12934
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Verified
+Status:           Closed
 Bug Type:         Date/time related
 Operating System: Linux
 PHP Version:      4.3.0-dev
 New Comment:

This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:
------------------------------------------------------------------------

[2002-07-03 19:25:52] [EMAIL PROTECTED]

strftime now returns false for negative values, but that doesn't solve
the inconsistency. I'm really undecided if this is a Date/Time-problem
or simply a lack of proper documentation.


------------------------------------------------------------------------

[2001-08-23 17:36:11] [EMAIL PROTECTED]

This:

  echo strftime("%Y-%m-%d %H:%M:%S", -200000);

outputs an empty string. However, this:

  $foo = localtime(-200000000); echo $foo[5]+1900;

outputs "1963" in Linux 2.2.15, but outputs an empty string in Win2k.
While negative time_t is undefined according to POSIX, time functions
should probably work consistently, and strftime() should never output
nothing. (That is, since there is no error condition documented for
strftime(), this:

  echo strftime("HONK", -200000);

should /always/ output "HONK", even if the %-values end up empty
because of the undefined meaning of negative time values.)

So, either strftime with negative time values should work,
or localtime with negative time values should fail (and the rest of the
time functions made consistent with either decision). If it's decided
that negative time values are to cause the functions to fail, then
error conditions should probably be defined or documented for those
functions (and maybe even warnings?).

(To be clear, that's not "PHP is nonconforming", but rather
"undocumented and nonportable inconsistency amongst *time functions is
a particularly icky form of nasal demon".)


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=12934&edit=1

Reply via email to