Get Example source ABAP code based on a different SAP table
System Time Zone and User Time Zone Two time zones> are preconfigured in AS ABAP, the system time zone> and the user time zone>.
The system time zone is the client-specific time zone of the system time> and the system date> and cannot be changed while the system is running. It is contained in the column TZONESYS> in the client-specific database table TTZCU >>.
The user time zone is a client-specific time zone that can be defined for the user time> and user date> of each individual user in the user master record>. It is contained in the system field sy-zonlo>. BEGIN_SECTION VERSION 5 OUT Both time zones are displayed in transaction SU01> > on the Defaults> tab, however only the user time zone can be changed here and is only effective as of a new logon. END_SECTION VERSION 5 OUT If no user time zone is defined in the user master record, or the specified time zone is invalid or inactive, the default value from the column TZONEDEF> in the database table TTZCU>> is used. If it is invalid or inactive, the system field sy-zonlo> is filled with blanks.
Latest notes:
The current client's system time zone can be read using the function module GET_SYSTEM_TIMEZONE>>.
The implementations of the methods of class CL_DEMO_DATE_TIME>> return the values summarized in the current topic. NON_V5_HINTS ABAP_HINT_END
ABAP_EXAMPLE_VX5 Determination of the date and time in the system time zone from a time stamp. ABEXA 01323 ABAP_EXAMPLE_END
System Time and System Date The system time and the system date are the local time and local date of an AS ABAP in the system time zone. They are produced by regular synchronizations of the clock of the ABAP runtime server> and the clock of the database server. During synchronization, the ABAP runtime framework clock is set to the database server clock. Since this happens on all ABAP_ASINSTANCES > of an AS ABAP>, the ABAP runtime framework clock of an AS instance is synchronized with the clocks of all other ABAP_ASINSTANCE s and with the database system clock, and therefore shows the system time and system date of the entire AS ABAP. The character-like system fields> sy-uzeit> and sy-datum> are provided with the system time and system date at certain times.
Latest notes: NON_V5_HINTS From a technical perspective, the ABAP runtime framework clock is synchronized with that of the database server on request. If a time is required, for example, to fill system fields for date and time>, the system checks whether the last synchronization was performed during the specified interval. If this is not the case, synchronization is performed. ABAP_HINT_END
ABAP_EXAMPLE_VX5 Creation of a time stamp from the system date and system time. ABEXA 01324 ABAP_EXAMPLE_END
User Time and User Date The user time and the user date are the local time and local date of the current user, which are calculated from the system time and the user time zone. The character-like system fields > sy-timlo> and sy-datlo> are provided with the user time and user date at certain times. If sy-zonlo> is initial, sy-timlo> and sy-datlo> are given the same values as sy-uzeit> and sy-datum>, the system time and system date.
Latest notes: To determine the local time and local date from a UTC time stamp> created using GET TIME STAMP>>, the content of the system field sy-zonlo> can be passed to the statement CONVERT TIME STAMP>>. An initial value for the time zone is implicitly set to UTC> and not to the system time zone in CONVERT TIME STAMP>. NON_V5_HINTS ABAP_HINT_END
ABAP_EXAMPLE_VX5 Determination of a local date and a local time from a time stamp. ABEXA 01325 ABAP_EXAMPLE_END