MySQL format date MM/dd/yyyy 

Joined:
04/09/2007
Posts:
773

March 08, 2011 15:53:33    Last update: March 08, 2011 15:53:33
Use the date_format function to format a date:
mysql> select now() now;
+---------------------+
| now                 |
+---------------------+
| 2011-03-08 18:45:22 |
+---------------------+
1 row in set (0.00 sec)

mysql> select date_format(now(), '%m/%d/%Y') today;
+------------+
| today      |
+------------+
| 03/08/2011 |
+------------+
1 row in set (0.00 sec)

Share |
| Comment  | Tags