How to get the current date and time of MySQL?

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

INSERT INTO servers (
server_name, online_status, exchange, disk_space, network_shares
) VALUES(
'm1', ' ONLINE','ONLINE', '100GB','ONLINE''DATETIME'
)

The last quoted DATETIME value is where I want to add the current date and time.

you can use NOW():

 INSERT INTO servers (server_name, online_status, exchange, disk_space, network_shares, c_time)
VALUES('m1','ONLINE','exchange','disk_space','network_shares', NOW())

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

INSERT INTO servers (
server_name, online_status, exchange, disk_space, network_shares
) VALUES(
'm1', ' ONLINE','ONLINE', '100GB','ONLINE''DATETIME'
)

The last quoted DATETIME value is where I want to add the current date and time.

You can use NOW():

INSERT INTO servers (server_name, online_status, exchange, disk_space, network_shares, c_time)
VALUES('m1','ONLINE','exchange','disk_space','network_shares', NOW())

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 2997 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.