ID: 30753 User updated by: ecit12 at hotmail dot com Reported By: ecit12 at hotmail dot com Status: Bogus Bug Type: Date/time related Operating System: Fedore Core 2 PHP Version: 4.3.8 New Comment:
Hello, Sorry for the duplicate. I couldn't find a way to edit my submission. Anyway, this thread can be deleted I guess. Previous Comments: ------------------------------------------------------------------------ [2004-11-10 23:15:08] [EMAIL PROTECTED] 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. Thank you for your interest in PHP. DUplicate of #30753 ------------------------------------------------------------------------ [2004-11-10 22:02:05] ecit12 at hotmail dot com Description: ------------ Basically, I wanted to take a normal time stamp that is in the form of YYYYMMDDHHMMSS and convert it to Unix format using the Date function. The last $myDate variable should match the initial date, but it doesn't work. It would be nice if PHP had more support for normal date formats instead of forcing ppl to convert to unix time. Reproduce code: --------------- $myDate = 20041110113800 // 2004, Nov 10, 11:38:00 echo "The date in normal form: $myDate"; echo "<BR>"; $myDate = date("U",$myDate); echo "The date in Unix format: $myDate"; echo "<BR>"; // added 00 for seconds since PHP has nothing for seconds $myDate = date("YmdHi",$myDate)."00"; echo "The date in Normal format again: $myDate"; Expected result: ---------------- The date in normal form: 20041110113800 The date in Unix format: 1100086680 The date in Normal format again: 20041110113800 Actual result: -------------- The date in normal form: 20041110113800 The date in Unix format: 792710664 The date in Normal format again: 19950213132400 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30753&edit=1