ID: 29946 Updated by: [EMAIL PROTECTED] Reported By: zukker at gmail dot com -Status: Open +Status: Bogus Bug Type: Date/time related Operating System: RH 9.1, WinXP PHP Version: 5.0.1 New Comment:
Duplicate of http://bugs.php.net/bug.php?id=28209. Previous Comments: ------------------------------------------------------------------------ [2004-09-02 10:49:57] zukker at gmail dot com Description: ------------ I notified that code like echo date('r', strtotime('1 day ago')); always returns 00:00:00 time for last day, but if I use code echo date('r', mktime(date('h'), date('i'), date('s'), date('m'), date('d') - 1, date('Y'))); it returns date representation with a correct time, exactly one day ago. Why it always returns midnight time for last day? If I use '24 hours ago' or '84600 seconds ago' - I got the same wrong time of midnight. Reproduce code: --------------- echo date('r', mktime(date('h'), date('i'), date('s'), date('m'), date('d') - 1, date('Y'))), '<br />'; echo date('r', strtotime('1 day ago')), '<br />'; echo date('r', strtotime('24 hours ago')), '<br />'; echo date('r', strtotime('86400 seconds ago')), '<br />'; Expected result: ---------------- Wed, 1 Sep 2004 12:48:54 +0400 Wed, 1 Sep 2004 12:48:54 +0400 Wed, 1 Sep 2004 12:48:54 +0400 Wed, 1 Sep 2004 12:48:54 +0400 Actual result: -------------- Wed, 1 Sep 2004 12:48:54 +0400 Wed, 1 Sep 2004 00:00:00 +0400 Wed, 1 Sep 2004 00:00:00 +0400 Wed, 1 Sep 2004 00:00:00 +0400 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=29946&edit=1
