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: 

Function Module To Change TIME from GMT to CST

Former Member
0 Kudos

Hello All,

Can anyone tell me if there is any Function Module to convert the TIME from GMT to CST?

Regards

3 REPLIES 3

Former Member
0 Kudos

Hi Sunil,

use the following code.

DATA :

timestamp like TZONREF-TSTAMPS,

time like sy-uzeit,

date like sy-datum.

  • The following function module is used to convert the

  • time and date into GMT timestamp

CALL FUNCTION 'IB_CONVERT_INTO_TIMESTAMP'

EXPORTING

i_datlo = sy-datum

i_timlo = sy-uzeit

I_TZONE = 'INDIA'

IMPORTING

E_TIMESTAMP = timestamp.

  • The following function module is used to convert the

  • above obtained timestamp to PST timezone date and time.

CALL FUNCTION 'IB_CONVERT_FROM_TIMESTAMP'

EXPORTING

i_timestamp = timestamp

I_TZONE = 'CST'

IMPORTING

E_DATLO = date

E_TIMLO = time.

write 😕 'Date and Time at PST zone is ',date, time.

Reward if helpful.

Thanks,

Naveen.

Former Member
0 Kudos

Get the time difference using the following Logic:

1) Use table TTZZ to get the ZONERULE, DSTRULE and FLAGACTIVE

for TZONE = 'CST'.

2) Then use table TTZR with ZONERULE and FLAGACTIVE to get the time difference in field UTCDIFF, and the operator (+/-) in field UTCSIGN,

3) Also refer to table TTZD for Summer time rules(day light saving).

Then use table TTZD with DSTRULE and FLAGACTIVE to get the DSTDIFF.

<b>Add up UTCDIFF and DSTDIFF to get the time difference.</b>

Use this time difference to calculate time in CST.

Lokesh

Pls. reward points if it helps.

Former Member
0 Kudos

Thank You Very Much