Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

mysql date format

-- Converts 'dd.mm.yyyy' to date	(my_date_col is VARCHAR)
SELECT STR_TO_DATE(my_date_col,'%d.%m.%Y') AS my_strdate FROM my_table;
-- Converts 'dd.mm.yyyy' to 'YYYY-MM-DD'
SELECT DATE_FORMAT(STR_TO_DATE(my_date_col,'%d.%m.%Y'), '%Y-%m-%d') AS my_strdate
	FROM my_table;
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #mysql #date #format
ADD COMMENT
Topic
Name
9+6 =