Possible Duplicate:
Change date format (in DB or output) to dd/mm/yyyy – PHP MySQL
PHP – Convert to date format dd/mm/yyyy
mysql saves my date and times like this…
2011-08-31 08:48:40
And when I echo them from the database this is how they appear, how can I get them to a universal format like m/d/y…
Or does it not matter if the mysql row is not a DATE_TIME and just VARCHAR and insert it into the database how I want it??
Thanks…
Do it in PHP:
Or do it in MySQL:
Of course you won’t use hardcoded values in your code. You’ll use the column name for MySQL or the retrieved column value, that’s probably an element in an array, in PHP.