时间戳函数

  

 DATA gv_tstamps TYPE tzonref-tstamps.

生成时间戳

  CALL FUNCTION 'CIF_GEN4_CONVERT_DATETIME'
      EXPORTING
        iv_date                = gv_date "日期
        iv_time                = gv_time "时间
        iv_timezone            = sy-zonlo   "时区
      IMPORTING
        ev_timestamp           = gv_tstamps    "时间戳
      EXCEPTIONS
        time_conversion_failed 1
        OTHERS                 2.

分解时间戳

      CALL FUNCTION 'ZCIF_GEN4_CONVERT_TIMESTAMP'
        EXPORTING
          iv_timestamp           = gv_tstamps    "时间戳
          iv_timezone            = sy-zonlo
        IMPORTING
          ev_date                = gv_date "日期
          ev_time                = gv_time "时间
        EXCEPTIONS
          time_conversion_failed 1
          OTHERS                 2.

猜你喜欢

转载自www.cnblogs.com/lingxiaoj/p/12802862.html