#30545 [Opn->WFx]: strototime() returns -1 on @timestamp
| From: | derick@php.net | Date: | Sun, 24 Oct 2004 11:02:38 +0000 |
| Subject: | #30545 [Opn->WFx]: strototime() returns -1 on @timestamp | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-68029@lists.php.net to get a copy of this message | ||
ID: 30545
Updated by: derick@php.net
Reported By: tightcode_nosp at m_hotmail dot com
-Status: Open
+Status: Wont fix
Bug Type: Date/time related
Operating System: Linux
PHP Version: 4.3.9
New Comment:
What's the point of doing this in the first place? strtotime() returns
the number of seconds, so why do you want to use that as input
parameter? This will not be added.
Previous Comments:
------------------------------------------------------------------------
[2004-10-24 10:32:07] tightcode_nosp at m_hotmail dot com
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 this bug report at http://bugs.php.net/?id=30545&edit=1