How to get current date & time in MySQL?

后端 未结 10 1221
情深已故
情深已故 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:55

    In database design, iIhighly recommend using Unixtime for consistency and indexing / search / comparison performance.

    UNIX_TIMESTAMP() 
    

    One can always convert to human readable formats afterwards, internationalizing as is individually most convenient.

    FROM_ UNIXTIME (unix_timestamp, [format ])
    

提交回复
热议问题