SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
ABAP Keyword Documentation → ABAP − Reference → Processing Internal Data → Date and Time Processing → Time Stamp →Time Stamps - Overview
Representation of Time Stamps
Time stamps are represented using packed numbers of the type p. There is a short form and a long form.
A valid time time stamp must contain valid date and time information before the decimal separator:
A time valid in the Gregorian calendar must be represented. Leap seconds are not supported.
Access to Time Stamps
Only a few statements recognize that packed numbers of the types TIMESTAMP and TIMESTAMPL are time stamps. All other statements interpret the content of these data types numerically and are not suitable for handling time stamps. The following statements can be used to handle time stamps:
The following settings for formatting output also handle time stamps in a specific way:
The system class CL_ABAP_TSTMP provides methods for adding, subtracting, converting, and comparing time stamps.
Notes on Handling Time Stamps
Time stamps are only interpreted as such when they are accessed by the statements, methods, and functions listed above. When being assigned or converted, they behave like packed numbers of the type p. Therefore, time stamps are not suitable for direct calculations. Comparisons produce a meaningful result only when two time stamps are compared with each other. In programs for which the program attribute Fixed Point Arithmetic is not set, note the rules applying to the data type p. In particular, direct comparisons of time stamps in the long form with the short form produce a meaningful result only when the program attribute fixed point arithmetic is set. Otherwise, the system class CL_ABAP_TSTMP must be used for comparisons as well. When assigning time stamps in the long form to time stamps in the short form, unwanted rounding effects occur. For this reason, always use the method MOVE of the system class CL_ABAP_TSTMP.
When time stamps are used in operand positions where they are not supposed to be used, no warnings are given by the syntax check or by the extended program check (not even in lossless assignments).