How to get current date & time in MySQL?

后端 未结 10 1213
情深已故
情深已故 2020-11-29 17:18

Is there a value or command like DATETIME that I can use in a manual query to insert the current date and time?

INSERT INTO servers (
  server_name, online_         


        
10条回答
  •  甜味超标
    2020-11-29 17:36

    You can use not only now(), also current_timestamp() and localtimestamp(). The main reason of incorrect display timestamp is inserting NOW() with single quotes! It didn't work for me in MySQL Workbench because of this IDE add single quotes for mysql functions and i didn't recognize it at once )

    Don't use functions with single quotes like in MySQL Workbench. It doesn't work.

提交回复
热议问题