LoginSignup
1
0

More than 5 years have passed since last update.

Laravel初心者のためのエラー対応履歴

Last updated at Posted at 2019-01-16

DBへのタイムスタンプに値を設定するときの注意点

created_at に '1970-01-01 00:00:01' を設定しようとすると、
Incorrect datetime value: '1970-01-01 00:00:01' for column 'created_at' のエラーが発生した。
調査の結果、UTCを考慮した '1970-01-01 09:00:01' であれば解決した。

最低値がまた変動する可能性を考えて、今後は下記がよさげ。
Carbon::createFromTimestamp(1)->toDateTimeString();

1
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
1
0