Ask a Question related to PHP Bugs, Design and Development.
-
simone at ivg dot it #1
#40645 [NEW]: strtotime don't work with negative timestamps
From: simone at ivg dot it
Operating system: Linux 2.6
PHP version: 4.4.5
PHP Bug Type: Date/time related
Bug description: strtotime don't work with negative timestamps
Description:
------------
The strtotime() function returns -1 if the date is prior to 1970-01-01.
Instead, date function works properly with negative timestamps.
Reproduce code:
---------------
strtotime("1951-12-22") returns -1
date("d/m/Y",-578944001) returns 28/08/1951
--
Edit bug report at [url]http://bugs.php.net/?id=40645&edit=1[/url]
--
Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=40645&r=trysnapshot44[/url]
Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=40645&r=trysnapshot52[/url]
Try a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=40645&r=trysnapshot60[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=40645&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=40645&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=40645&r=needtrace[/url]
Need Reproduce Script: [url]http://bugs.php.net/fix.php?id=40645&r=needscript[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=40645&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=40645&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=40645&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=40645&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=40645&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=40645&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=40645&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=40645&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=40645&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=40645&r=gnused[/url]
Floating point limitations: [url]http://bugs.php.net/fix.php?id=40645&r=float[/url]
No Zend Extensions: [url]http://bugs.php.net/fix.php?id=40645&r=nozend[/url]
MySQL Configuration Error: [url]http://bugs.php.net/fix.php?id=40645&r=mysqlcfg[/url]
simone at ivg dot it Guest
-
Error Selecting Timestamps - String Index out of Range
We are running CFMX 6.1 on Linux Connecting to a PostgreSQL 7.X database cluster. When we try to perform a query that selects a timestamp from... -
Acrobat 6.0.2 won't save Advanced Print setups and Negative Doesn't work
I am having lots of problems getting Acrobat 6.0.x to work. Mac OS 10.3.t. I tried all versions and updated to the current version. When I go to... -
Number of milliseconds between two timestamps
Hi all, I am trying to determine the difference between two timestamps in milliseconds. Is there any easy or difficult method of getting this... -
Problem with putting timestamps in date fields after Fix 10 (DB2 7.2)
Hello out there, why does DB2 7.2 Fix 10 not more allow to put timestamps in date fields. In prior versions the time information was ignored.... -
#15123 [Dup->Csd]: strtotime doesn't work with long date format
ID: 15123 Updated by: sniper@php.net Reported By: htheking at gmx dot de -Status: Duplicate +Status: ... -
derick@php.net #2
#40645 [Opn->Fbk]: strtotime don't work with negative timestamps
ID: 40645
Updated by: [email]derick@php.net[/email]
Reported By: simone at ivg dot it
-Status: Open
+Status: Feedback
Bug Type: Date/time related
Operating System: Linux 2.6
PHP Version: 4.4.5
New Comment:
This works fine for me with PHP 4.4.6RC2-dev:
<?php
echo strtotime("1951-12-22"), "\n";
?>
-568947600
Previous Comments:
------------------------------------------------------------------------
[2007-02-26 17:55:41] simone at ivg dot it
Description:
------------
The strtotime() function returns -1 if the date is prior to
1970-01-01.
Instead, date function works properly with negative timestamps.
Reproduce code:
---------------
strtotime("1951-12-22") returns -1
date("d/m/Y",-578944001) returns 28/08/1951
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=40645&edit=1[/url]
derick@php.net Guest
-
simone at ivg dot it #3
#40645 [Fbk->Csd]: strtotime don't work with negative timestamps
ID: 40645
User updated by: simone at ivg dot it
Reported By: simone at ivg dot it
-Status: Feedback
+Status: Closed
Bug Type: Date/time related
Operating System: Linux 2.6
PHP Version: 4.4.5
New Comment:
This isn't a PHP bug, but a GNU libc issue.
Here I've found a C code to test if my libc has the problem:
[url]http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=196177[/url]
Thanks.
Previous Comments:
------------------------------------------------------------------------
[2007-02-26 18:01:02] [email]derick@php.net[/email]
This works fine for me with PHP 4.4.6RC2-dev:
<?php
echo strtotime("1951-12-22"), "\n";
?>
-568947600
------------------------------------------------------------------------
[2007-02-26 17:55:41] simone at ivg dot it
Description:
------------
The strtotime() function returns -1 if the date is prior to
1970-01-01.
Instead, date function works properly with negative timestamps.
Reproduce code:
---------------
strtotime("1951-12-22") returns -1
date("d/m/Y",-578944001) returns 28/08/1951
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=40645&edit=1[/url]
simone at ivg dot it Guest
-
tony2001@php.net #4
#40645 [Csd->Bgs]: strtotime don't work with negative timestamps
ID: 40645
Updated by: [email]tony2001@php.net[/email]
Reported By: simone at ivg dot it
-Status: Closed
+Status: Bogus
Bug Type: Date/time related
Operating System: Linux 2.6
PHP Version: 4.4.5
Previous Comments:
------------------------------------------------------------------------
[2007-02-27 14:27:30] simone at ivg dot it
This isn't a PHP bug, but a GNU libc issue.
Here I've found a C code to test if my libc has the problem:
[url]http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=196177[/url]
Thanks.
------------------------------------------------------------------------
[2007-02-26 18:01:02] [email]derick@php.net[/email]
This works fine for me with PHP 4.4.6RC2-dev:
<?php
echo strtotime("1951-12-22"), "\n";
?>
-568947600
------------------------------------------------------------------------
[2007-02-26 17:55:41] simone at ivg dot it
Description:
------------
The strtotime() function returns -1 if the date is prior to
1970-01-01.
Instead, date function works properly with negative timestamps.
Reproduce code:
---------------
strtotime("1951-12-22") returns -1
date("d/m/Y",-578944001) returns 28/08/1951
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=40645&edit=1[/url]
tony2001@php.net Guest



Reply With Quote

