ABAP - Keyword Documentation →  ABAP - Programming Language →  Processing Internal Data →  Date and Time Processing →  Time Stamps →  Time Stamp Fields with Time Stamp Type → 
Mail Feedback

System Class for Time Stamp Fields

The Class Library contains the following system class for handling time stamps in time stamp fields:

This class provides the following methods:

The attributes MIN and MAX contain the minimum and maximum values of the time stamp type utclong.

Hint

An initial time stamp passed to the method DIFF is handled here like the smallest possible value of a time stamp.

Example

Comparison of the method DIFF with the built-in function utclong_diff.

FINAL(ts_low)  = utclong_current( ).
FINAL(ts_high) = utclong_add( val     = ts_low
                             seconds = 100000 ).

FINAL(diff) = utclong_diff( high = ts_high
                           low  = ts_low ).

cl_abap_utclong=>diff( EXPORTING high     = ts_high
                                 low      = ts_low
                       IMPORTING days    = FINAL(days)
                                 hours   = FINAL(hours)
                                 minutes = FINAL(minutes)
                                 seconds = FINAL(seconds) ).

ASSERT diff = 100000.
ASSERT diff = 86400 * days + 3600 * hours + 60 * minutes + seconds.

Executable Example

Read Time Stamp from String