你是指别的格式不支持,例如:19670921(1967年9月21日)这样的不支持?
mysql> select year(20030415012345),year(19670921);
+----------------------+----------------+
| year(20030415012345) | year(19670921) |
+----------------------+----------------+
| 2003 | 1967 |
+----------------------+----------------+
1 row in set (0.03 sec)下面是mysql5.0 reference manual上的例子,你最好查一下有关的日期函数。
In MySQL 5.0, TIMESTAMP can also be used; GET_FORMAT() returns the same values as for DATETIME. mysql> SELECT DATE_FORMAT('2003-10-03',GET_FORMAT(DATE,'EUR'));
-> '03.10.2003'
mysql> SELECT STR_TO_DATE('10.31.2003',GET_FORMAT(DATE,'USA'));
-> '2003-10-31'还有date_format(date,format)函数。
mysql> select year(20030415012345),year(19670921);
+----------------------+----------------+
| year(20030415012345) | year(19670921) |
+----------------------+----------------+
| 2003 | 1967 |
+----------------------+----------------+
1 row in set (0.03 sec)下面是mysql5.0 reference manual上的例子,你最好查一下有关的日期函数。
In MySQL 5.0, TIMESTAMP can also be used; GET_FORMAT() returns the same values as for DATETIME. mysql> SELECT DATE_FORMAT('2003-10-03',GET_FORMAT(DATE,'EUR'));
-> '03.10.2003'
mysql> SELECT STR_TO_DATE('10.31.2003',GET_FORMAT(DATE,'USA'));
-> '2003-10-31'还有date_format(date,format)函数。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货