diekiss
金牌会员
 
高级会员
UID 18243
精华
0
积分 1399
帖子 1375
金钱 1399 喜悦币
威望 0
人脉 0
阅读权限 70
注册 2003-2-3 来自 狮山俊景
状态 离线
|
[推荐阅读] 2年php程序员求职--用心去做
如果 MySQL 表中设置了 date_time 根本就不可能存储有'2007-12-11 71:72:23' 这样的记录的。
如果你这个 field 是 varchar等string类型,可以试试:
STR_TO_DATE(str,format)
This is the inverse of the DATE_FORMAT() function. It takes a string str and a format string format. STR_TO_DATE() returns a DATETIME value if the format string contains both date and time parts, or a DATE or TIME value if the string contains only date or time parts.
The date, time, or datetime values contained in str should be given in the format indicated by format. For the specifiers that can be used in format, see the DATE_FORMAT() function description. If str contains an illegal date, time, or datetime value, STR_TO_DATE() returns NULL. Starting from MySQL 5.0.3, an illegal value also produces a warning.
| 
无限风光在险峰
|
|