From:             serge at skycomp dot ca
Operating system: Linux
PHP version:      4.3.11
PHP Bug Type:     Date/time related
Bug description:  strtotime loosing 2 hours

Description:
------------
It seems that strtotime is loosing time.  I'm loosing 2 hours on every
call to it and I'm not sure why.

The issue seems to be with the "at" text in the format string but I am
unsure why the text "at" would make the timestamp lose exactly 2 hours.

Reproduce code:
---------------
<?
$_REQUEST['event_time']=strftime('%A, %B %e %Y at
%r',strtotime($_REQUEST['event_time']));
?>
<form action='<?=$_SERVER['PHP_SELF']?>'>
<input size='50' type='text' name='event_time'
value='<?=$_REQUEST['event_time']?>'
<input type="submit">
</form>

Expected result:
----------------
The output should be the formated representation from what was inputted. 
If sumbit is clicked again without changed the text field the value should
not change since strtotime should generate a proper and valid timestamp
which strftime formats again.

Actual result:
--------------
Relative to today I type:

friday at 7pm

click submit and the value of the text box is now:
Friday, June 24 2005 at 05:00:00 PM

I don't type or change anything. Simply click submit again:
Friday, June 24 2005 at 03:00:00 PM

Every time I click submit the timestamp looses 2 hours.

-- 
Edit bug report at http://bugs.php.net/?id=33456&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=33456&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=33456&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=33456&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=33456&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=33456&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=33456&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=33456&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=33456&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=33456&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=33456&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=33456&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=33456&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=33456&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=33456&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=33456&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=33456&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=33456&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=33456&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=33456&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=33456&r=mysqlcfg

Reply via email to