11-29-2007 5:53 PM
Hello All,
Can anyone tell me if there is any Function Module to convert the TIME from GMT to CST?
Regards
11-29-2007 6:01 PM
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.
11-29-2007 6:23 PM
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.
02-20-2008 4:17 PM