Related Documentation Download this Manual
PDF (US Ltr) - 0.6Mb
PDF (A4) - 0.6Mb


HeatWave User Guide  /  ...  /  Date and Time Functions

11.2.6 Date and Time Functions

The following table shows supported date and time functions. The VARLEN Support column identifies functions that support variable-length encoded string columns. See Section 3.3, “Encoding String Columns”.

Table 11.5 Date and Time Functions

Name VARLEN Support Description
ADDDATE() Add time values (intervals) to a date value
ADDTIME() Yes Add time
CURDATE() Return the current date
CURRENT_DATE(), CURRENT_DATE Synonyms for CURDATE()
CURRENT_TIME(), CURRENT_TIME Synonyms for CURTIME()
CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP Synonyms for NOW()
CURTIME() Return the current time
DATE() Yes Extract the date part of a date or datetime expression
DATE_ADD() Yes Add time values (intervals) to a date value
DATE_FORMAT() Yes Format date as specified
DATE_SUB() Subtract a time value (interval) from a date
DATEDIFF() Subtract two dates
DAY() Yes Synonym for DAYOFMONTH()
DAYNAME() Yes Return the name of the weekday
DAYOFMONTH() Yes Return the day of the month (0-31)
DAYOFWEEK() Return the weekday index of the argument
DAYOFYEAR() Yes Return the day of the year (1-366)
EXTRACT() Extract part of a date
FROM_UNIXTIME() Format Unix timestamp as a date
HOUR() Yes Extract the hour
LOCALTIME(), LOCALTIME Synonym for NOW()
LOCALTIMESTAMP, LOCALTIMESTAMP() Synonym for NOW()
MAKEDATE() Create a date from the year and day of year. Supports FLOAT, DOUBLE, INTEGER, and YEAR type values.
MICROSECOND() Yes Return the microseconds from argument
MINUTE() Yes Return the minute from the argument
MONTH() Yes Return the month from the date passed
MONTHNAME() Yes Return the name of the month
NOW() Return the current date and time
QUARTER() Yes Return the quarter from a date argument
SECOND() Return the second (0-59)
STR_TO_DATE() Yes Convert a string to a date
SUBTIME() Yes Subtract times
TIME() Yes Extract the time portion of the expression passed
TIME_FORMAT() Yes Format as time.
TIME_TO_SEC() Return the argument converted to seconds
TIMESTAMP() Yes With a single argument, this function returns the date or datetime expression; with two arguments, the sum of the arguments
TIMESTAMPDIFF() Yes Subtract an interval from a datetime expression
TO_DAYS() Yes Return the date argument converted to days
TO_SECONDS() Yes Return the date or datetime argument converted to seconds since Year 0
UNIX_TIMESTAMP() Return a Unix timestamp
WEEK() Yes Return the week number. Restrictions apply. See Section 11.6, “Limitations”
WEEKDAY() Return the weekday index
WEEKOFYEAR() Return the calendar week of the date (1-53)
YEAR() Yes Return the year
YEARWEEK() Return the year and week