yandoo Posted July 19, 2009 Share Posted July 19, 2009 Hi there, Im thinking this should be fairly straightforward. Im trying to change the date format from a recordset date that is retrieved from my database. As the date is: <?php echo $query ['date']; ?> I just need to add the correct (d-m-y) formatting. I can do this easily when applying the current date. e.g. <?php echo date('d-m-y'); ?> But how can it be done from a date retrieved form a database? Thanks Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted July 19, 2009 Share Posted July 19, 2009 Use the mysql DATE_FORMAT() function directly in your SELECT query to retrieve the date any way you want - http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_date-format Quote Link to comment 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.