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: 

How to convert time from one time zone to another ?

Former Member

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

7 REPLIES 7

Former Member
0 Kudos

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

Former Member
0 Kudos

This message was moderated.

vikas2
Active Participant

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' .

Former Member
0 Kudos

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

Former Member
0 Kudos

This message was moderated.

former_member184569
Active Contributor

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

arindam_m
Active Contributor
0 Kudos

Hi,

Check WRITE TO with TIME ZONE format options.

Cheers,

Arindam