【MySQL笔记】字符串、时间日期转换
1、新增一列,将字符串日期(年、月、日)转换为Date类型

报错:Error Code: 1175. You are using safe update:http://jingyan.baidu.com/article/e5c39bf58ed69239d76033a4.html
2、unix时间戳和普通时间之间的转换:

SELECT now(); #现在时间
SELECT unix_timestamp(now()); 现在时间转换为unix时间戳
SELECT from_unixtime(unix_timestamp(now())); unix时间戳转换为现在时间

浙公网安备 33010602011771号