时间戳函数

  

 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.

posted on 2020-04-29 16:12  Shadow.Ling  阅读(1083)  评论(0编辑  收藏  举报

导航