System Fields for Date and Time

The following table lists the system fields for the date and time. 

System field Content

Tcode: SE16 

Table: SYST -> ABAP System Fields

sy-datlo Date in the current user's time zone. 

sy-datum System date (Local date of the AS ABAP). 

sy-dayst Indicator for summer time. During summer time, "X", otherwise " ". 

sy-fdayw Factory calendar weekday. "1" for Monday, ..., "5" for Friday. 

sy-timlo Time in the current user's time zone. 

sy-tzone Time difference from the UTC reference time in seconds, ignoring summer time.

sy-uzeit System time (Local time of the AS ABAP). 

sy-zonlo User's time zone. 

The values of all system fields in this table are implicitly set when the program is started, every time a screen layout of a screen is sent, and when the internal mode is set. The GET TIME command explicitly updates the system fields, except for sy-dayst, sy-fdayw, sy-tzone, and sy-zonlo. 

With the exception of sy-datlo and sy-timlo, all system fields refer to the local date and time of the current AS ABAP. The ABAP runtime environment clock is synchronized with the database server clock at regular intervals in order to calculate the local time of an AS ABAP. During the synchronization process, the ABAP runtime environment clock is set to the database server clock. Because this happens on all application servers in an AS ABAP the ABAP runtime environment clock is synchronous with the clocks on all other application servers and with the database system clock, and thus shows the local time of the entire AS ABAP. The time zone on which the local time of an AS ABAP is based is the only entry in the database table TTZCU.

The content of sy-zonlo is taken from the user master record of the current user. The values of sy-datlo and sy-timlo are calculated from sy-datum and sy-uzeit and from the time zone of the AS ABAP for the time zone in sy-zonlo. If the user master record does not contain a time zone, or if it contains an invalid or an inactive time zone, sy-datlo and sy-timlo are set to the values of sy-datum and sy-uzeit. All valid time zones are defined in table TTZZ.

Note: 

The following calculation delivers the day of the week for a date field containing any valid date. 1 means Monday, 2 means Tuesday, and so on.

day = ( 5 + date  MOD 7 ) MOD 7  + 1. 

ABAP

Read Also
How to add hours, minutes and seconds

ABAP Books List
ABAP/4 Certification, Programming, Smartforms, Sapscripts and Object Oriented Programming Books

Smart Forms
SAP Smartforms

ABAP Menu:
ABAP Example Hints and Tips

Return to Index:-
SAP ABAP/4 Programming, Basis Administration, Configuration Hints and Tips

(c) www.gotothings.com All material on this site is Copyright.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
All product names are trademarks of their respective companies.  The site www.gotothings.com is in no way affiliated with SAP AG.
Any unauthorised copying or mirroring is prohibited.