views:

33

answers:

2

My query returns the row value as "2/27/2010 12:00:00 AM" but I need to get "2/27/2010". What do I use to get the format as I need it for MySQL?

+3  A: 

Use:

SELECT DATE_FORMAT(your_date_column, '%c/%d/%Y') FROM table
Piotr Pankowski
goog thankshow to use this in in insert query
Ayyappan.Anbalagan
if column type is date/datetime/timestamp all you have to do is:UPDATE table SET date_column = NOW()If you need special formatting:UPDATE table SET date_column = DATE_FORMAT(NOW(), '%c/%d/%Y')
Piotr Pankowski
+2  A: 

use the date_format function. This site will help you show you how to format the date http://www.mysqlformatdate.com

Gerard