#36338 [NEW]: Integer Timestamps are not enough!

From: Date: Thu, 09 Feb 2006 11:27:37 +0000
Subject: #36338 [NEW]: Integer Timestamps are not enough!
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-93068@lists.php.net to get a copy of this message
From:             carsten dot moldenhauer at mailbox dot tu-dresden dot de
Operating system: Linux
PHP version:      5.1.2
PHP Bug Type:     Date/time related
Bug description:  Integer Timestamps are not enough!

Description:
------------
Hello PHP Team.

I recently discovered a problem with standard timestamps. They are stored
as integers. Integers have a range up to 2147483647.

date( "Y-m-d H:i:s", 2147483647 ) results in:
2038-01-19 04:14:07

If you got a date after 2038 in text format and want to convert it to
integer, you will get back 2147483647. So you are back in 2038 again.

I would dislike to see all the time related PHP applications break on the
above date.

Is there any possibility to switch timestamps to long?
(btw, the same occurs with dates before 1901-12-13 21:45:52 which is date(
"Y-m-d H:i:s, -2147483648 ))

I am looking forward to your answers.


-- 
Edit bug report at http://bugs.php.net/?id=36338&edit=1
-- 
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36338&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36338&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36338&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=36338&r=fixedcvs
Fixed in release:             http://bugs.php.net/fix.php?id=36338&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=36338&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=36338&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=36338&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=36338&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=36338&r=notwrong
Not enough info:              http://bugs.php.net/fix.php?id=36338&r=notenoughinfo
Submitted twice:              http://bugs.php.net/fix.php?id=36338&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=36338&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=36338&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=36338&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=36338&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=36338&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=36338&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=36338&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=36338&r=mysqlcfg


Thread (4 messages)

« previous php.bugs (#93068) next »