Converting timestamps into local time
Differences between UTC time and local time or summertime
The rules for converting UTC timestamps into local time
(or vice versa) are stored in the tables
TTZZ, TTZR,
TTZD, TTZDF,
and TTZDV. TTZZ
contains the time zones and the rules for the time difference between the time zone, its summertime,
and UTC time. The differences themselves are stored in tables TTZR and TTZD.
Summertime rules
The rules for the beginning and end of summertime in the different time zones are stored in tables
TTZDF and TTZDV.
Fixed-date rules are stored in table TTZDF, variable rules
in table TTZDV. Where summertime is determined by fixed-date
rules, the beginning and end of summertime are linked firmly to dates for a particular year. For variable
rules, you can specify a year from which the rule applies. The beginning and end dates are given as a day in the n-th week of the month (for example, summertime begins on the first Sunday in March).
Further notes:
-
All entries in table
TTZZ for ZONERULE
must appear in table TTZR as well, and all entries for
DSTRULE must also appear in table TTZD. Equally,
all entries for
DSTRULE from table TTZD
must appear in table
TTZDF and/or TTZDV,
unless field
DSTDIFF contains a time difference of 00:00:00
for a given DSTRULE.
If the above condition is not met, the ABAP processor regards the rule caculation as inconsistent and triggers a runtime error.
- The ABAP processor interprets the fixed-date rules from table TTZDF,
before reading the variable rules from table TTZDV.
- If summertime inncludes the turn of the year (Southern Hemisphere), the system interprets the given summertime as beginning in the current year.
-
The beginning of summertime in tables
TTZDF and TTZDV
is recorded such that the specified time does not lie within wintertime. The first second of summertime
is the time you get when you add the summertime difference to the specified time.
Equally, the end
of summertime is recorded such that the specified time does not lie within summertime. The first second of wintertime is the time you get when you subtract the summertime difference from the specified time.
- A consequence of the beginning of summertime is that there is a period that technically can be expressed
as a time, but which does not exist as local time. The conversion routines in the ABAP processor treat
this as an inconsistent date, time, or timestamp.
For example, if summertime begins at 02:00 and
the summertime difference is one hour, the period between 02:00 and 03:00 is not a valid time in local
time.
Equally, at the end of summertime, there is a period that exists twice in local time. The ABAP processor always adds this time to the summertime.