Cosizzle Posted December 22, 2009 Share Posted December 22, 2009 Hey guys, I'm having to restore an old database. Within the database are dates formatted as a timestamp for example: 1251308836. I've created a script (see below) to alter this. However I do not get a year. I did some digging around and it sounds like this is a bug? http://bugs.php.net/bug.php?id=49079&edit=1 What do you guys think? $oldDate = 1251308836; echo $oldDate.'<br>'; // output: 1251308836 echo date('d-m-Y',$oldDate); // output: 26-08-0000 Link to comment https://forums.phpfreaks.com/topic/186080-date-formatting/ Share on other sites More sharing options...
Cosizzle Posted December 22, 2009 Author Share Posted December 22, 2009 Just solved my own problem. Turns out that my version of MAMP is running an older version of PHP with this bug. Tested it on a webserver and got a proper result. Link to comment https://forums.phpfreaks.com/topic/186080-date-formatting/#findComment-982668 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.