ABAP - Keyword Documentation →  ABAP - Dictionary →  Built-In Functions in ABAP Dictionary →  Special Functions → 

Date Functions and Time Functions

The following table shows the date and time functions supported by ABAP CDS and Open SQL. The last two columns indicate where a function can be used.

SQL Function Result ABAP CDS Open SQL
DATS_IS_VALID( date ) Shows whether the argument is a valid date. x x
DATS_DAYS_BETWEEN( date1, date2 ) Difference between two dates. x x
DATS_ADD_DAYS( date, days , on_error ) Total of days and a date. x x
DATS_ADD_MONTHS( date, months, on_error ) Total of months and a date. x x
TIMS_IS_VALID( time ) Shows whether the argument is a valid time. x -
TSTMP_IS_VALID( tstmp ) Shows whether the argument is a valid time stamp. x -
TSTMP_CURRENT_UTCTIMESTAMP( ) Current UTC time stamp. x -
TSTMP_SECONDS_BETWEEN( tstmp1, tstmp2, on_error ) Difference between two time stamps in seconds. x -
TSTMP_ADD_SECONDS( tstmp, seconds, on_error ) Total of seconds and a time stamp. x -
TSTMP_TO_DATS( tstmp, tzone, clnt, on_error ) Local date of a time stamp. x -
TSTMP_TO_TIMS( tstmp, tzone, clnt, on_error ) Local time of a time stamp. x -
TSTMP_TO_DST( tstmp, tzone, clnt, on_error ) Local summer time marker of a time stamp. x -
DATS_TIMS_TO_TSTMP( date, time, tzone, clnt, on_error ) Time stamp for a local date and a local time. x -
ABAP_SYSTEM_TIMEZONE( clnt, on_error ) System time zone of AS ABAP. x -
ABAP_USER_TIMEZONE( user, clnt, on_error ) User time zone of AS ABAP. x -

Descriptions of the potential operands and data types can be found in the corresponding documentation for ABAP CDS and Open SQL.