0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

NOW()

Posted at

insertで行を加えようとした。

INSERT INTO tables(name, created_at, updated_at) 
VALUES ("A", 2023-02-05, 2023-02-05);

[22001][1292] Data truncation: Incorrect datetime value: '2016' for column 'created_at' at row 1.

どうやらdatetimeの値が正確ではないらしい。
どうすればいいかを探していたところ。

NOW()

INSERT INTO timestamp_n_datetime(ts,dt)
VALUES(NOW(),NOW());

出典

気づき

多分MYSQLのチュートリアルだと思われる。
これを使えばどうやら今のdatetimeの値を得ることができるらしい。

感想

エラーが出ずに成功した。
よかった。
まだこんなことも知らない。でも知ることができてよかった。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?