ID: 33456 User updated by: serge at skycomp dot ca Reported By: serge at skycomp dot ca -Status: Feedback +Status: Open Bug Type: Date/time related Operating System: Linux PHP Version: 4.3.11 New Comment:
Ok I'll see about testing it agains the latest CVS if I have a chance. A 100% php example is as follows: <? $timestr="Friday at 7pm"; print "Starting Value: '$timestr'\n"; for( $x=1; $x<=10; $x++) { $timestr=strftime('%A, %B %e %Y at %r',strtotime($timestr)); print "The string is now: '$timestr'\n"; } ?> Previous Comments: ------------------------------------------------------------------------ [2005-06-24 00:58:40] [EMAIL PROTECTED] Right. And I didn't ask you to upgrade the server. I asked to to try the latest snapshot. And I'd really appreciate if you provide a reproduce code without HTML/forms/etc. Just a plain, short and clean PHP code that demonstrates the problem. Thanks in advance. ------------------------------------------------------------------------ [2005-06-24 00:55:09] serge at skycomp dot ca This server does not run php5. It's on php4 ------------------------------------------------------------------------ [2005-06-24 00:48:26] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip ------------------------------------------------------------------------ [2005-06-24 00:13:31] serge at skycomp dot ca 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 this bug report at http://bugs.php.net/?id=33456&edit=1