在这件事上,MySQL 允许我们使用迄今为止宽松的格式。我们可以在日期部分之间使用任何标点符号作为分隔符。一些示例如下 -
mysql> Select date ('2016/10/20');
+---------------------+
| date ('2016/10/20') |
+---------------------+
| 2016-10-20 |
+---------------------+
1 row in set (0.00 sec)
mysql> Select date('2016^10^20');
+--------------------+
| date('2016^10^20') |
+--------------------+
| 2016-10-20 |
+--------------------+
1 row in set (0.00 sec)
mysql> Select date ('2016@10@20');
+---------------------+
| date ('2016@10@20') |
+---------------------+
| 2016-10-20 |
+---------------------+
1 row in set (0.00 sec)
mysql> Select date ('2016+10+20');
+---------------------+
| date ('2016+10+20') |
+---------------------+
| 2016-10-20 |
+---------------------+
1 row in set (0.00 sec)