LoginSignup
0
0

More than 3 years have passed since last update.

タイムゾーンはちゃんと設定しよう

Posted at

サービスを開発する際、最初にタイムゾーンをしっかり設定していないと、MySQLのcreated_at や updated_at などをうまく使えないというようなことになります。

MySQLでは、カラムにcreated_at や updated_atなどを加えると、それぞれSQLのinsertやupdateが実行されたときに自動でtimestampを入れてくれたりします。

始めにしっかり設定しておかないと、あとから必要になったときに、自力でそれらの値を取得して挿入するはめになってしまいます。(実体験)

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