How to get the current date and time in MySQL?

SELECT NOW(), CURDATE(), CURTIME();

NOW() returns something like 2025-01-15 10:30:00, CURDATE() returns 2025-01-15 and CURTIME() returns 10:30:00. The values change every second. Use DEFAULT CURRENT_TIMESTAMP to save the creation time of a row. See Date Functions.


Learn more about the similar topics:
Tutorials
No Content Found.
Exercises & Assignments
No Content Found.
Interview Questions & Answers
No Content Found.