2013 Feb 20 6:28 PM
Hi,
Is there a FM that will give the time difference between two timezones and also would give a sign as plus if the difference is to be added or minus if that difference is to be subtracted respectively.
2013 Feb 20 7:06 PM
Hi Amber,
I think there is no such function modules as per me.
But u can use these function module to create timestamp to date & time and date & Time to timestamp.
1. B_CONVERT_INTO_TIMESTAMP' or
2. IB_CONVERT_FROM_TIMESTAMP'
Use function module 1 two times for two different time zones and calculate it later as below
For Example:-
Data:
time_diff type t.
* The following function module is used to convert the
* time and date into GMT timestamp
CALL FUNCTION 'IB_CONVERT_INTO_TIMESTAMP'
EXPORTING
i_datlo = sy-datum
i_timlo = sy-uzeit
I_TZONE = 'INDIA'
IMPORTING
E_TIMESTAMP = timestamp.
* The following function module is used to convert the
* time and date into GMT timestamp
CALL FUNCTION 'IB_CONVERT_INTO_TIMESTAMP'
EXPORTING
i_datlo = sy-datum
i_timlo = sy-uzeit
I_TZONE = 'U.K'
IMPORTING
E_TIMESTAMP = timestamp1.
time_diff = timestamp - timestamp1.
so u can have time difference between INDIA and U.K timezones
Regards,
Vineesh.B
2013 Feb 20 9:12 PM
2013 Feb 21 2:10 AM
Hi,
See whether this helps.
Try function module /OSP/TIMEZONE_RULE.
This will give you the +/- value you are expecting in return parameter ES_TTZZ-ZONEDESC. But it will give you the difference with respect to UTC. You may have to call this function module again with the second time zone & calculate it.
With regards,
Gokul
2013 Feb 21 2:15 AM
Or may be if /OSP function modules are not available in your system, try function module TZON_GET_DATA or TZON_GET_OFFSET or for that matter, you can go through function group TZ_UTIL to check all the available function modules related to this.
Regards,
Gokul