ID:               30545
 Updated by:       [EMAIL PROTECTED]
 Reported By:      tightcode_nosp at m_hotmail dot com
-Status:           Wont fix
+Status:           Closed
 Bug Type:         Date/time related
 Operating System: Linux
 PHP Version:      4.3.9
 New Comment:

Actually, this was added in PHP 5.1.


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

[2004-10-24 14:04:43] tightcode_nosp at m_hotmail dot com

You say this will not be added... why was it removed in the first place
? According to the docs the functionality should exist.
To answer your question as to why, because it allows more flexibility
for testing a date. It is my understanding that this function takes a
string and tries to return a date from that string. Whether the date is
expressed in text(Next Monday), iso standard timestamp(2004-04-04
04:04), or seconds since enoch(1147468399), the function shouldn't
care. Why is it making an exception ? If it is fed a valid timestamp,
-3600 to 2147468399 or whatever the two extremes are, it should pass
that value right back through, not return -1.
Does that make more sense now that I have explained ? I am not always
good at explaining things so thanks for being patient.

Thanks for your previous prompt response by the way,

TightCode

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

[2004-10-24 13:02:37] [EMAIL PROTECTED]

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.

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

[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

Reply via email to