修改匯入錯誤的日期資料

回覆文章
yehlu
Site Admin
文章: 3244
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

修改匯入錯誤的日期資料

文章 yehlu »

http://www.php5.idv.tw/modules.php?mod= ... &shid=2463

匯入資料日期時原格式為
58-5-8
民國58
不處理直接匯到資料庫的日期欄位
結果顯示為2058-05-08
Mysql會自動加上2000年

您可以
update 資料表 set birthday = birthday-890000
每個人則直接減掉89年,為何是890000
因為
2058-05-08
- 89-00-00
得到正確的
1969-05-08
回覆文章

回到「MySQL」