Functions that return dates

Functions that return dates

Description

Example

CURDATE

CURRENT_DATE

Returns today’s date

 

CURTIME

CURRENT_TIME

Returns the current time

 

CURTIMESTAMP

CURRENT_TIMESTAMP

Returns the current timestamp value

 

TIMESTAMPVAL

Converts a character string to a timestamp

TIMESTAMPVAL('2028-01-30 14:00:00') returns its timestamp value

DATE

TODAY

Returns today’s date

If today is 11/21/2028, DATE() returns 2028-11-21

DATEVAL

Converts a character string to a date

DATEVAL('2028-01-30') returns 2028-01-30

Note  The DATE() function is deprecated. Use the SQL standard CURRENT_DATE instead.