ARTICLE
Converting Time Stamps
This example demonstrates the statements
CONVERT TIME STAMP and
CONVERT INTO TIME STAMP .
ABAP_SOURCE_CODE
ABAP_EXEC
ABAP_DESCRIPTION
The program is given a date, a time, and a time zone and converts this
information into a time stamp . The program
can also include summer time in its calculations. The resulting time
stamp is then converted to the local date and local time of another time
zone. The following table shows several possible combinations of input
and output, where spc stands for a space and - for no
input or output.
date1 time1 tz1 dst1 ts tz2
date2 time2 dst2 sy-subrc
16.07.2010 09:10:00 CET -
2010-07-16T07:10:00 CET 16.07.2010 09:10:00
X -
16.07.2010 09:10:00 CET X
2010-07-16T07:10:00 CET 16.07.2010 09:10:00
X -
16.07.2010 09:10:00 CET spc -
CET - - - 12
16.12.2010 09:10:00 CET spc
2010-12-16T08:10:00 CET 16.12.2010 09:10:00
- -
16.12.2010 09:10:00 CET X -
CET - - - 12
16.12.2010 09:10:00 AUSTAS -
2010-12-15T22:10:00 AUSTAS 16.12.2010 09:10:00
X -
The third and fifth rows demonstrate that invalid summer time data
produces the value 12 in sy-subrc .
Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved