你可以將它們轉換成DATETIME
,它會存儲你想要的。比較:
MariaDB [test]> create table t (t timestamp, d datetime);
Query OK, 0 rows affected (0.59 sec)
MariaDB [test]> insert into t values ('2850-12-01 00:00:00','2850-12-01 00:00:00');
Query OK, 1 row affected, 1 warning (0.08 sec)
MariaDB [test]> select * from t;
+---------------------+---------------------+
| t | d |
+---------------------+---------------------+
| 0000-00-00 00:00:00 | 2850-12-01 00:00:00 |
+---------------------+---------------------+
1 row in set (0.00 sec)
這工作的一種享受。我沒有意識到DATETIME在mySQL中可用 - 後來有人告訴我,將代碼從MSSQL移動到mySQL時,必須將DATETIME轉換爲TIMESTAMP! – John