ID:               25981
 Updated by:       [EMAIL PROTECTED]
 Reported By:      hazen at edsbits dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Date/time related
 Operating System: Red Hat Linux
 PHP Version:      4.3.3
 New Comment:

Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments
to the existing bug instead.

Thank you for your interest in PHP.

See bug #20382



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

[2003-10-24 18:22:35] hazen at edsbits dot com

Description:
------------
I have code which uses human readable text to generate dates for use in
a task management program which stores due dates in a MySQL database. 
I have been using the strtotime() function for some months with no
problem.  Now that it is near a change in daylight savings time, I'm
finding some odd behavior.

It is currently Friday October 24, 2003.

When I enter "tuesday", the function returns 10-27-2003, not 10-28-2003
as it should.  For a sanity check, I also entered "today + 4 days"
which correctly returned 10-28-2003.  If I enter "Saturday" or
"Sunday", it correctly returns 10-25-2003 and 10-26-2003 respectively.

Anything after Sunday is off by one day.

Reproduce code:
---------------
<?php

$date_in = $_POST['date_in'];
$date_out = date("Y-m-d", strtotime($date_in));

PRINT<<<END
<H3>strtotime( ) tester</H3>

<PRE>
Input:    $date_in
Output:   $date_out
</PRE>

<FORM ACTION="datetest.phtml" METHOD="post">
<INPUT TYPE="Text" SIZE="20" NAME="date_in" VALUE="$date_in"><BR>
<INPUT TYPE="Submit" VALUE="Test Date">
</FORM>

END;

?>


Expected result:
----------------
That it returns the correct calendar date

Actual result:
--------------
It returns one day off, as explained in the description above.  I also
tested this bug on a second machine running PHP 4.3.2 with the same
result.


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


-- 
Edit this bug report at http://bugs.php.net/?id=25981&edit=1

Reply via email to