Hello. Newbie asking for help on converting date formats. I have a working uery that will convert a date format from mm/dd/yyyy to yyyy-mm-dd. I need to be able to convert to yyyy-mm-dd the variations that occur when the months and days are single digits and the year is 2 digits (m/dd/yyyy, m/d/yyyy, mm/d/yyyy, m/d/yy, mm/d/yy, m/dd/yy, m/d/yy, etc.). Here is the code I have so far:
PHP Code:
mysql_query("UPDATE compsin SET date = CONCAT(SUBSTRING(date, 7, 4),'-',SUBSTRING(date, 1, 2),'-',SUBSTRING(date, 4, 2))");
Thanks in advance.