04-10-2006 12:56 PM
Hi,
I have a requirement to find the time difference between two countries. For ex: if its<b> 6 pm 9 - 4 - 2006 in usa it should be converted to 5 am 10 - 4 - 2006 indian time .
Is there any funtion module to achieve this ?
Thanks alot in Advance.
04-10-2006 1:09 PM
Hi,
You can use FM JIT03_CONVERT_TIME_BY_TIMEZONE.
Regards,
Raj
04-10-2006 1:14 PM
HI Rajni Kanth,
Use the table TTZ5Z to get the time zone for the Country.
Use the table TTZZ to get the zone rule for the time zone.
Use the table TTZR to get the Difference of time zone from UTC for the zone rule.
Do the above steps for the two countries and find the Difference between the "Difference of time zone from UTC" values resulted in the two cases.
REgards,
Ravi
04-10-2006 1:24 PM
Hi,
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.
The necessary code is in the following link..
<a href="http://searchsap.techtarget.com/tip/1,289483,sid21_gci826364,00.html">time zone difference</a>
regards,
chithra
04-10-2006 1:33 PM
Hi
Check this out,I hope this will help to solve your problem.
CONVERT for Timestamps
Converts a timestamp into the correct date and time for the current time zone.
Syntax
CONVERT TIME STAMP <tst> TIME ZONE <tz> INTO DATE <d> TIME <t>.
CONVERT DATE <d> TIME <t> INTO TIME STAMP <tst> TIME ZONE <tz>.
As long as <tst> has type P(8) or P(11) with 7 decimal placed, and <tz> has type C(6), the time stamp <tst> will be converted to the correct date <d> and time <t> for the time zone <tz>.
REPORT ZTIMEZONES .
*************************************************
Written by : Parvathaneni Suresh Kumar *
Date : 20-May-2002 *
*************************************************
*************************************************
In no event the author is responsible for *
indirect, special, incidental or consequental *
damages (if any) arising out of the use of *
this report *
*************************************************
*****************************************************
This program is used to convert the times between *
different timezones. This program deals with the *
conversion of time from INDIA timezone to the PST *
timezone *
*****************************************************
Declaring the work variables.......................
DATA :
timestamp like TZONREF-TSTAMPS,
time like sy-uzeit,
date like sy-datum.
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
above obtained timestamp to PST timezone date and time.
CALL FUNCTION 'IB_CONVERT_FROM_TIMESTAMP'
EXPORTING
i_timestamp = timestamp
I_TZONE = 'PST'
IMPORTING
E_DATLO = date
E_TIMLO = time.
write 😕 'Date and Time at PST zone is ',date, time.
Thanks
Mrutyunjaya Tripathy
04-10-2006 1:50 PM
Use function module <b>SD_DATETIME_DIFFERENCE
CCU_TIMESTAMP_DIFFERENCE</b>
regards
vinod
04-10-2006 2:59 PM
Hi,
use the FM....
data:l_time TYPE t,
l_date type sy-datum,
l_tzone TYPE ttzdata-tzone,
l_tstmp TYPE timestamp.
CALL FUNCTION 'TZON_LOCATION_TIMEZONE'
EXPORTING
if_country = l_land1
IMPORTING
ef_timezone = l_tzone
EXCEPTIONS
no_timezone_found = 1
OTHERS = 2.
l_ctime = sy-uzeit. " Get current server time
l_datum = sy-datum. " Get current server date
CONVERT DATE l_datum
TIME l_ctime
INTO TIME STAMP l_tstmp TIME ZONE sy-zonlo.
CONVERT TIME STAMP l_tstmp TIME ZONE
l_tzone
INTO DATE l_date
TIME l_time.
Thanks,
Pramod