Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想更新表中的日期字段。我目前正在从 mm/dd/yy ie(05/06/13) 格式的表单中获取日期值。我希望将日期转换为 Ymd(即 2013-05-06)格式并进行更新。我使用了 DATE_FORMAT 但日期没有更新。
UPDATE tableName SET coldate = DATE_FORMAT(STR_TO_DATE(colDate,'%m/%d/%y'),'%Y/%m/%d')