on 2020 Oct 04 9:28 PM
Hello,
I need to find out what time it is in another country city. How can I follow a path through functions in SE37 tcode.
For example my time and date is 23:22, 04.10.2020 in GMT + 3 time zone.
I want to learn Germany's time in GMT + 2 time zone.
Best regards.
Good works.
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
Hi gsekercan,
This is regarding the conversion of time between different time zones. In order to achieve this, first we need to convert the time to standard GMT and from GMT to the required time zone.
The following function modules does the same.
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 time zone, 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 time zone. The input parameters for this are the timestamp obtained from the above function module and the time zone, to which the time needs to be converted.
The output parameters are the date, time in the required time zone.
Code
REPORT ZTIMEZONES .
*****************************************************
* This program is used to convert the times between *
* different time zones. This program deals with the *
* conversion of time from INDIA time zone to the PST *
* time zone *
*****************************************************
* 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 time zone 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.
Cheers,
Luis
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use this FM to convert present GMT to UTC CL_KF_HELPER=>TIMESTAMP_LOCAL_ZONE_2_UTC
and convert UTC to required GMT using CL_KF_HELPER=>TIMESTAMP_UTC_2_LOCAL_ZONE
You can look at zones in table TTZ5. For IN it is 'INDIA' .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 28 | |
| 14 | |
| 13 | |
| 6 | |
| 5 | |
| 5 | |
| 4 | |
| 4 | |
| 4 | |
| 4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.