Application Development and Automation 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: 
Read only

Function module for converting German Data/Time to Indian Date/Time

Former Member
0 Likes
788

Dear All,

My requirement is to convert German date and time to Indian date and time. Is there any function module available or any way we can get it?

Thanks and regards,

Atanu

2 REPLIES 2
Read only

Former Member
0 Likes
491
hi,

 first get the timezone of that country

CALL FUNCTION 'TZON_LOCATION_TIMEZONE'
      EXPORTING
        if_country        = p_it_userid-zcountry
      IMPORTING
        ef_timezone       = l_tzone
      EXCEPTIONS
        no_timezone_found = 1
        OTHERS            = 2.

then use the below statements

-- Convert from server time to GMT
      CLEAR l_tstmp.
      CONVERT DATE l_datum
              TIME l_ctime
         INTO TIME STAMP l_tstmp TIME ZONE sy-zonlo.

*-- Convert from GMT to user backup time
      CONVERT TIME STAMP l_tstmp TIME ZONE it_usr_timezone-ztzone
        INTO DATE it_usr_timezone-zdate
             TIME it_usr_timezone-ztime.
Read only

0 Likes
491

you can use CONVERT TIME STAMP

CONVERT TIME STAMP tst TIME ZONE tz INTO DATE d TIME t.

CONVERT DATE d TIME t INTO TIME STAMP tst TIME ZONE tz.