Date and Time Functions
Macro Name
Returns
Description
ADD_MONTHS
One column for each input column
Returns a date after adding the specified number of months
CURRENT_DATE
One column for each input column
Returns the current date in
format
CURRENT_DAY
One column for each input column
Returns the current day of the month as a number from 1-31
CURRENT_JULIAN
One column for each input column
Returns the Julian number for the current date
CURRENT_MONTH
One column for each input column
Returns the current month of the year as a number from 1-12
CURRENT_TIME
One column for each input column
Returns the current time as a string
CURRENT_WEEKDAY
One column for each input column
Returns the current weekday of the month as a number from 0-6
CURRENT_YEAR
One column for each input column
Returns the current year as a number
DATE
One column for each input column
Converts a date string into a Julian date
DATE_FORMAT
One column for each input column
Transforms date formats
DATE_JULIAN
One column for each input column
Returns the Julian date
DATE_STRING
One column for each input column
Returns the date string of the Julian date
DAY_BETWEEN
One column for each input column
Returns the number of days between two dates
DAY_FROMNOW
One column for each input column
Returns the number of days from the current date to the specified date
DAY_INTERVAL
One column for each input column
Returns the number of days between two dates
DAYOF
One column for each input column
Returns the day of the month as a number
MONTHOF
One column for each input column
Returns the month of the year as a number
WEEKDAY
One column for each input column
Converts ASCII text date strings to the day of the week
WEEKDAYOF
One column for each input column
Returns the weekday of the week as a number
YEAROF
One column for each input column
Returns the year as a number
Copyright IBM Corporation 2013. All Rights Reserved.