09-04-2008 7:13 AM
Hi All,
In my program there is date field is there it is in display mode we may not able to change it, in the output it is showing system date and time when we are using that program in india,
but I want to show it in the US date and time wherever it will open for this is there any function module is there.
Thanks and regards,
Krish...........
09-04-2008 7:34 AM
Hi,
Check the difference of time with GMT.
Check the Function Module ADD_TIME_TO_DATE. To add the time to get the US time and u can show it. I think this function module will be helpful.
Regards,
Kasuladevi
09-04-2008 7:17 AM
hi,
just add the time difference to the variable in which u r passing ur date.
09-04-2008 7:18 AM
Try SET COUNTRY,
try the following link,
or SAP online help.
Edited by: avinash ravipati on Sep 4, 2008 11:51 AM
09-04-2008 7:20 AM
09-04-2008 7:23 AM
Here you go...
Use the function module IB_CONVERT_INTO_TIMESTAMP and 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 time stamp 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.
Sample Code
REPORT ZTIMEZONES .
***************************************************
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.
09-04-2008 7:28 AM
Hello Krish.
Every date field possibly is LIKE sy-datum and the Time field is LIKE sy-uzeit.
Whether it is run anywhere it will show the current date and time of that place.
That should not be a problem.
But, Still If I have mis-interpreted your question. Do let me know.
Good Luck & Regards.
Harsh Dave
09-04-2008 7:34 AM
Hi,
Check the difference of time with GMT.
Check the Function Module ADD_TIME_TO_DATE. To add the time to get the US time and u can show it. I think this function module will be helpful.
Regards,
Kasuladevi