时间转换
2018-08-01 本文已影响0人
风口得猪会飞
DATA: seconds_per_day(8) TYPE p VALUE 86400,
rel_date LIKE sy-datum VALUE '19700101',
rel_zeit LIKE sy-uzeit VALUE '000000'.
DATA: l_datum TYPE datum.
DATA: l_zeit TYPE uzeit.
DATA: l_timestmp TYPE numc13.
DATA: hh TYPE num2,
mm TYPE num2,
ss TYPE num2.
l_datum = sy-datum - rel_date.
l_zeit = sy-uzeit - rel_zeit.
hh = l_zeit+0(2) .
mm = l_zeit+2(2).
ss = l_zeit+4(2).
l_timestmp = l_datum * seconds_per_day + hh * 3600 + mm * 60 + ss - 8 * 3600.
l_timestmp = l_timestmp * 1000.
s_timestmp = l_timestmp.
第二张方法call func :IB_CONVERT_INTO_TIMESTAMP