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 Quote 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)); ?> Quote Link to comment https://forums.phpfreaks.com/topic/85012-solved-date-format/#findComment-433503 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.