You can replace the hyphen (-) and colon (:) characters with any other punctuation character without affecting
validity.
mysql>
mysql> CREATE TABLE tt(ts DATETIME);
mysql>
mysql> INSERT INTO tt(ts) VALUES('1999+11+11 23-24');
Query OK, 1 row affected (0.00 sec)
mysql>
mysql> INSERT INTO tt(ts) VALUES('1999+12=12-12-12');
Query OK, 1 row affected (0.00 sec)
mysql>
mysql> select * from tt;
+---------------------+
| ts |
+---------------------+
| 1999-11-11 23:24:00 |
| 1999-11-11 23:24:00 |
| 1999-11-11 23:24:00 |
| 1999-12-12 12:12:00 |
+---------------------+
4 rows in set (0.00 sec)
mysql>
mysql> drop table tt;
Query OK, 0 rows affected (0.00 sec)
Related examples in the same category