Skip to content

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 ABAP SQL. The last two columns indicate where a function can be used.

SQL Function Result ABAP CDS ABAP 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 x
TSTMP_IS_VALID( tstmp ) Shows whether the argument is a valid time stamp. x x
TSTMP_CURRENT_UTCTIMESTAMP( ) Current UTC time stamp. x x
TSTMP_SECONDS_BETWEEN( tstmp1, tstmp2, on_error ) Difference between two time stamps in seconds. x x
TSTMP_ADD_SECONDS( tstmp, seconds, on_error ) Total of seconds and a time stamp. x x
TSTMP_TO_DATS( tstmp, tzone, clnt, on_error ) Local date of a time stamp. x x
TSTMP_TO_TIMS( tstmp, tzone, clnt, on_error ) Local time of a time stamp. x x
TSTMP_TO_DST( tstmp, tzone, clnt, on_error ) Local summer time marker of a time stamp. x x
DATS_TIMS_TO_TSTMP( date, time, tzone, clnt, on_error ) Time stamp for a local date and a local time. x x
ABAP_SYSTEM_TIMEZONE( clnt, on_error ) System time zone in AS ABAP. x x
ABAP_USER_TIMEZONE( user, clnt, on_error ) User time zone in AS ABAP. x x

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

Other versions: 7.31 | 7.40 | 7.54