Skip to Content
avatar image
Former Member

How to convert time from one time zone to another ?

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

7 Answers

  • May 28, 2013 at 03: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' .

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 28, 2013 at 03: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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 28, 2013 at 03:57 AM

    This message was moderated.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 28, 2013 at 04: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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 28, 2013 at 05:02 AM

    This message was moderated.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 28, 2013 at 05: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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 28, 2013 at 06:10 AM

    Hi,

    Check WRITE TO with TIME ZONE format options.

    Cheers,

    Arindam

    Add comment
    10|10000 characters needed characters exceeded