DAY(), DAYOFMONTH() — Returns the day of the month as an integer value.
DAY( timestamp-value )
DAYOFMONTH( timestamp-value )
The DAY() function returns an integer value between 1 and 31 representing the timestamp's day of the month. The DAY() and DAYOFMONTH() functions are synonyms. These functions produce the same result as using the DAY or DAY_OF_MONTH keywords with the EXTRACT() function.
The following example uses the DAY(), MONTH(), and YEAR() functions to return a timestamp column as a formatted date string.
SELECT CAST( MONTH(starttime) AS VARCHAR) || '/' || CAST( DAY(starttime) AS VARCHAR) || '/' || CAST( YEAR(starttime) AS VARCHAR), title, description FROM event ORDER BY starttime;