Пример преобразования sy-zonlo (можно использовать любой другой пояс) в UTC
На выходе получим timestamp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
FORM convert_timezone USING time_zone date time utc CHANGING et_return timestamp . CLEAR timestamp. DATA t_datetime TYPE TABLE OF swfxst_date_time. APPEND VALUE #( date = date time = time ) TO t_datetime. CALL FUNCTION '/OSP/TIMEZONE_DETERMINE' EXPORTING iv_timezone = time_zone to_utc = utc IMPORTING et_return = et_return TABLES t_datetime = t_datetime. IF et_return IS INITIAL. timestamp = |{ t_datetime[ 1 ]-date }{ t_datetime[ 1 ]-time }|. ENDIF. ENDFORM. |
Пример вызова
1 2 3 4 5 6 7 8 |
PERFORM convert_timezone USING sy-zonlo so_rdate-low lv_time 'X' CHANGING et_return lv_timestamp. DATA(timestamp) = lv_timestamp. |