LoginSignup
0
0

More than 5 years have passed since last update.

MySQL 5.6(Oracle版)にアップデートしたら、datetimeのInsertで怒られた

Last updated at Posted at 2015-03-16

![]http://cdn-ak.f.st-hatena.com/images/fotolife/m/makoto1899/20150121/20150121182146.jpg)

Ubuntu 14.04LTSを、MySQL 5.6(Oracle版)にアップデートしたら、datetimeのInsertで怒られた! その対処法。

なんか、「ALLOW_INVALID_DATES」って、いうのがキーワードらしいんですが、PHPソースを直すことにより対応。

// $date = "Tue, 20 Jan 2015 12:20:53 +0900"
// $sdate = "2013-08-25T17:00:00+00:00"
$tpdate = new DateTime($date);
$sdate = $tpdate->format('Y-m-d\TH:i:s');

こんな感じらしい。じゃ!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0