Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Local time of the user

Former Member
0 Kudos

Hi all,

Is there any function module to get the Local time of the user

as like SY-timlo..

Thanks a lot in advance

Regards,

Lakshma

5 REPLIES 5

Former Member
0 Kudos

hi,

Check out SY-UZEIT

0 Kudos

Hi,

Its SY-TIMLO which gives local time for user.

Former Member
0 Kudos

Hi,

You may try this FM: DB_LOCAL_TIME

Hope it helps,

Chang

former_member435013
Active Participant
0 Kudos

Hi,

I think there is no function for that.

Have a look at this small code sample.

It is for sy-uname but making a function from ist shouldn't be very difficult:

REPORT test.

DATA:

tst LIKE ttzdata-timestamp,

tstp8(8) TYPE p,

i_logdat TYPE uslogond,

tzone LIKE i_logdat-tzone,

d LIKE sy-datum,

t LIKE sy-uzeit.

CALL FUNCTION 'TZ_UTC_SYSTEMCLOCK'

IMPORTING

  • UTC_DATE =

  • UTC_TIME =

utc_timestamp = tst. .

CALL FUNCTION 'SUSR_USER_READ'

EXPORTING

user_name = sy-uname

  • WITH_TEXT =

IMPORTING

user_logondata = i_logdat

  • USER_DEFAULTS = i_defaults

  • USER_ADDRESS =

  • REF_USER =

  • ALIAS =

  • TABLES

  • USER_PARAMETERS =

  • EXCEPTIONS

  • USER_NAME_NOT_EXISTS = 1

  • INTERNAL_ERROR = 2

  • OTHERS = 3

.

tzone = i_logdat-tzone.

IF tzone = ''.

tzone = sy-zonlo.

ENDIF.

tstp8 = tst.

CONVERT TIME STAMP tstp8 TIME ZONE tzone INTO DATE d TIME t.

regards

Walte Habich

Former Member

Hi,

You can find the current users local date/time as follows:

SY-DATLO Local Date for Current User

SY-TIMLO Local Time of Current User

SY-ZONLO Time Zone of Current User

check the FM : SUSR_USER_READ

Paramter : USER_LOGONDATA -TZONE

Regards

Kiran Sure