Ell20 Posted January 8, 2008 Share Posted January 8, 2008 Hi, I am having abit of a nightmare with displaying the date. I have set up my mysql field to be date, but that requires a format of Y, M, D and because im english, and this is going to be an english website I want the date to be in D, M, Y format. I have this: <?php echo $date2; date('Y-M-D', $date2); ?> The first prints: 2007-11-09 The second errors: An error occured in script /home/mysport/public_html/stats.php on line 93: A non well formed numeric value encountered What the best way to get this working properly? Thanks Link to comment https://forums.phpfreaks.com/topic/85012-solved-date-format/ Share on other sites More sharing options...
rajivgonsalves Posted January 8, 2008 Share Posted January 8, 2008 it should be <?php echo $date2; date('d-M-Y', strtotime($date2)); ?> Link to comment https://forums.phpfreaks.com/topic/85012-solved-date-format/#findComment-433503 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.