Date Functions
Date Functions
Example:
SELECT NOW();
Example:
SELECT CURDATE();
Example:
SELECT CURTIME();
Example:
SELECT DATE(NOW());
Example:
SELECT TIME(NOW());
6.LAST_DAY(): Returns the last day of the month for a given date.
SELECT LAST_DAY(NOW());
7.TIMEDIFF(): Returns the time difference between two time or datetime expressions.
SELECT TIMEDIFF('14:30:00', '12:15:30');
15.UNIX_TIMESTAMP(): Returns the Unix timestamp (seconds since January 1, 1970) for
a date or datetime expression.
SELECT UNIX_TIMESTAMP(NOW());
These functions provide various ways to work with date, time, and related values in
MySQL queries.