1、时间戳计算
*----------------------------------------Begin of 时间戳--------------------------------* DATA: dat TYPE sy-datum, tim TYPE sy-uzeit, timstmp TYPE timestamp. dat = sy-datum. tim = sy-uzeit. ** PERFORM convert_datum_to_timestamps USING dat tim CHANGING timstmp. WRITE: '现在时间:', timstmp. ***&---------------------------------------------------------------------* ***& Form convert_datum_to_timestamps ***&---------------------------------------------------------------------* FORM convert_datum_to_timestamps USING p_date TYPE d p_time TYPE t CHANGING p_timestamp TYPE timestamp. DATA: l_timezone LIKE ttzz-tzone VALUE 'UTC+8'. CONVERT DATE p_date TIME p_time INTO TIME STAMP p_timestamp TIME ZONE l_timezone. ENDFORM. *----------------------------------------End of 时间戳---------------------------------*
2、还可以直接调用function执行
CONVERT_INTO_TIMESTAMP
参数I_TZONE 可以 传入系统时区 SY-ZONLO,其他都是系统日期和系统时间。
最新评论