05-28-2013 4:30 AM
Hello Experts ,
How to convert the time from one time zone to another. Basically i have the following data with me :
Data , CST time . I need to convert this to Japanese (JST) time zone.
Also please guide me is it the right time zone value i am using for japanese. I.e JST.
Thanks and Regards,
NIkhil Kulkarni
Moderator Message - FAQ. Please refer to available documentation.
Message was edited by: Suhas Saha
05-28-2013 4:52 AM
Hi Nikhil
You can use this FM
ISU_DATE_TIME_CONVERT_TIMEZONE
To get the converted date and time for the specific time zone
Regards
Abhinav
05-28-2013 4:57 AM
05-28-2013 4:57 AM
Try the below :
CL_KF_HELPER=>TIMESTAMP_LOCAL_ZONE_2_UTC
and CL_KF_HELPER=>TIMESTAMP_UTC_2_LOCAL_ZONE
You can look at zones in table TTZ5. For JP it is 'JAPAN' .
05-28-2013 5:11 AM
Nikhil,
You can make use of CONVERT TIME STAMP statement to convert it to required time zone. Below
code snippet should give you some idea.
get tstamp field l_timestamp.
convert time stamp l_timestamp time zone 'JAPAN' into date l_date TIME l_time.
Reward points inf helpful,
~Athreya
05-28-2013 6:02 AM
05-28-2013 6:13 AM
Hi,
To get the right time zone values, refer table TTZZT. Here the time zone value for Japan in 'JAPAN'.
To convert to the required timezon, first we need to convert the time to standard GMT and from GMT to the required timezone.
The following function modules will do the required task.
The function module IB_CONVERT_INTO_TIMESTAMP is used to convert the time to the GMT. The input parameters are DATE, TIME and the TIMEZONE(user's timezone, default value SY-ZONLO). The output parameter is the timestamp in GMT.
The function module IB_CONVERT_FROM_TIMESTAMP is used to get the time in required timezone. The input parameters for this are the timestamp obtained from the above function module and the timezone, to which the time needs to be converted.
The output parameters are the date, time in the required timezone.
Other methods can be found in this link.
http://help.sap.com/abapdocu_70/en/ABAPCONVERT_TIME-STAMP.htm
You can also use the FM ISU_DATE_TIME_CONVERT_TIMEZONE to convert time in UTC to any other time zone.
Regards.
u
05-28-2013 7:10 AM