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: 

Time Zone conversion of a date/timestamp in ABAP

Former Member
0 Kudos

Is there a function available in 4.5B that can convert a date/timestamp from one timezone to another?

1 ACCEPTED SOLUTION

former_member181966
Active Contributor
0 Kudos

try FMS

/SAPTRX/RANGE_CONVERT

CONVERT_TIME_TERMS

CIF_GEN3_CONVERT_DATETIME

CIF_GEN3_CONVERT_TIMESTAMP

CIF_GEN_CONVERT_DATETIME

CIF_GEN_CONVERT_TIMESTAMP

CIF_GEN4_CONVERT_DATETIME

CIF_GEN4_CONVERT_TIMESTAMP

CO_SF_CONVERT_TIMES_OPR

CXTP

DATE_TIME_CONVERT

POINT_IN_TIME_CONVERT

FITP_CONVERT_LOCAL_TIME_GMT

<u><i><b>

Tip : GO to -> SE37 and search key word TIME OR Convert</b></i></u>

Hope this’ll give you idea!!

<b>P.S award the points.</b>

Good luck

Thanks

Saquib Khan

"Some are wise and some are otherwise"

5 REPLIES 5

former_member181966
Active Contributor
0 Kudos

try FMS

/SAPTRX/RANGE_CONVERT

CONVERT_TIME_TERMS

CIF_GEN3_CONVERT_DATETIME

CIF_GEN3_CONVERT_TIMESTAMP

CIF_GEN_CONVERT_DATETIME

CIF_GEN_CONVERT_TIMESTAMP

CIF_GEN4_CONVERT_DATETIME

CIF_GEN4_CONVERT_TIMESTAMP

CO_SF_CONVERT_TIMES_OPR

CXTP

DATE_TIME_CONVERT

POINT_IN_TIME_CONVERT

FITP_CONVERT_LOCAL_TIME_GMT

<u><i><b>

Tip : GO to -> SE37 and search key word TIME OR Convert</b></i></u>

Hope this’ll give you idea!!

<b>P.S award the points.</b>

Good luck

Thanks

Saquib Khan

"Some are wise and some are otherwise"

0 Kudos

hi Peter,

Check these FM's

CIF_GEN3_CONVERT_DATETIME

CIF_GEN3_CONVERT_TIMESTAMP

CIF_GEN_CONVERT_DATETIME

CIF_GEN_CONVERT_TIMESTAMP

CIF_GEN4_CONVERT_DATETIME

CIF_GEN4_CONVERT_TIMESTAMP

Regards,

Santosh

Note: Reward Points if helpful

0 Kudos

Guys,

None of these functions convert a date/timestamp to another timezone. I am looking for a function or any other way that will take a date and a time and a 'from timezone' and 'to timezone' as an input parameter and will return the date and time in the target time zone.

Peter

0 Kudos

I don't know what is available in 4.5B, but CALL METHOD cl_kf_helper=>timestamp_utc_2_local_zone worked for me. You may need to first convert your date to UTC before calling this method. Check the ABAP documentation on CONVERT DATE d TIME t DAYLIGHT SAVING TIME dst INTO TIME STAMP ctime TIME ZONE timezone.

0 Kudos

Hi Peter,

This code will do the time zone conversion.

CONVERT DATE lv_dat TIME lv_tim

INTO TIME STAMP lv_time_stamp TIME ZONE 'TIME ZONE'.

Also check FM 'ISU_DATE_TIME_CONVERT_UTC'.

Thanx & Rgds,

Krishna