#30545 [NEW]: strototime() returns -1 on @timestamp
| From: | tightcode_nosp at m_hotmail dot com | Date: | Sun, 24 Oct 2004 08:32:26 +0000 |
| Subject: | #30545 [NEW]: strototime() returns -1 on @timestamp | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-68028@lists.php.net to get a copy of this message | ||
From: tightcode_nosp at m_hotmail dot com
Operating system: Linux
PHP version: 4.3.9
PHP Bug Type: Date/time related
Bug description: strototime() returns -1 on @timestamp
Description:
------------
The docs state:
"Because strtotime() behaves according to GNU date syntax, have a look at
the GNU manual page titled Date Input Formats. Described there is valid
syntax for the time parameter."
However the functionality described here:
http://www.gnu.org/software/tar/manual/html_chapter/tar_7.html#SEC117
Which describes how to use seconds since Enoch, does not work with
strtotime().
I have tried both strtotime('@timestamp') and strtotime('timestamp'). Both
return -1. Please review the code below.
Reproduce code:
---------------
<?php
The correct way to do this according to the docs:
echo "Doc way: ".strtotime('@'.time());
Another try just to see if there is another way:
echo "Another way: ".strtotime(time());
?>
Expected result:
----------------
Doc way: (timestamp for current time)
Another way: (perhaps the same as above)
Actual result:
--------------
Doc way: -1
Another way: -1
I would expect there to be some way of doing this. If not according to the
doc & syntax referenced in the online docs, at least "another way".
Thanks,
TightCode
--
Edit bug report at http://bugs.php.net/?id=30545&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30545&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30545&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30545&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=30545&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=30545&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=30545&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=30545&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=30545&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=30545&r=support
Expected behavior: http://bugs.php.net/fix.php?id=30545&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=30545&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=30545&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=30545&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30545&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=30545&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=30545&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=30545&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=30545&r=float
MySQL Configuration Error: http://bugs.php.net/fix.php?id=30545&r=mysqlcfg