Skip to Content
author's profile photo Former Member
Former Member

Function required to convert local time to UTC

Hi,

I have a problem where I have to convert local time into UTC which I need to send to another system, I need to be able to send the UTC offset at the end eg.

internal timestamp = 20090312033000

output timestamp with UTC offset 2009-03-12T0333000+11

Thanks,

Steve.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

9 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Mar 12, 2009 at 05:34 AM

    hi:

    have a look

    [link|http://help.sap.com/abapdocu/en/ABAPCONVERT_TIME-STAMP.htm]

    Regards

    Shashi

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 12, 2009 at 05:36 AM

    Hi,

    Try this FM ISU_DATE_TIME_CONVERT_TIMEZONE

    Regards

    Bala Krishna

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 12, 2009 at 05:37 AM

    Use FM RKE_TIMESTAMP_CONVERT_INPUT

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 12, 2009 at 05:37 AM

    Hi,

    pls see the following statement:

    DATA: l_timestmp1 TYPE comt_changed_at_usr,

    s_date TYPE sy-datum.

    CONVERT DATE s_date TIME '000000' INTO TIME STAMP l_timestmp1 TIME

    ZONE sy-zonlo.

    Keerthi.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 12, 2009 at 05:38 AM

    'IB_CONVERT_INTO_TIMESTAMP'

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 12, 2009 at 05:41 AM

    Hi,

    Use this FM 'ISU_DATE_TIME_CONVERT_TIMEZONE'

    Regards,

    Jyothi CH.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 12, 2009 at 05:44 AM

    None of the above answers give me the offset they just convert into timestamp, I need the offset.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 12, 2009 at 05:48 AM

    Hi,

    Try these FM's

    /AIN/DM_CONVERT_LOCAL_TO_UTC - Conversion from Local to UTC Timestamp

    Regards,

    Jyothi CH.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 07, 2015 at 03:23 AM

    Hi, did you find the way to convert local time to UTC with offset? cause I'm facing the same problem... thanks!

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi, use FM TZON_GET_OFFSET

      IF_TIMEZONE -> sy-zonlo

      IF_LOCAL_DATE -> sy-datum

      IF_LOCAL_TIME -> sy-uzeit

      then use exporting parameters:

      EF_UTCDIFF -> 03:00:00

      EF_UTCSIGN -> -

      in my case.

      concatenate the variables to get the format required:

      CONCATENATE sy-datum(4) '-' sy-datum+4(2) '-' sy-datum+6(2)
      'T' sy-uzeit(2) ':' sy-uzeit+2(2) ':' sy-uzeit+4(2) EF_UTCSIGN EF_UTCDIFF
      INTO vl_utc_date_time.

      For me, it was required to use de following format:

      "YYYY-MM-DDThh:mm:ss±of:om" where:

      YYYY indicates the year

      MM indicates the month

      DD indicates the day

      T indicates the start of the required time section

      hh indicates the hour

      mm indicates the minute

      ss indicates the second

      ± indicate if the offset is positive or negative

      of indicate the offset in hour respect the UTC time

      om indicate the offset in minute respect the UTC time

      Hope it helps!

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.