//获取系统时间
#nSystemTime := RD_SYS_T(#stSystemTime);
//转换成字符串
#sYear := '';
VAL_STRG(IN := #stSystemTime.YEAR,
SIZE := 4,
PREC := 0,
FORMAT := 0,
P := 1,
OUT => #sYear);
#sMonth := '';
IF #stSystemTime.MONTH < 10 THEN
VAL_STRG(IN := #stSystemTime.MONTH,
SIZE := 1,
PREC := 0,
FORMAT := 0,
P := 1,
OUT => #sMonth);
#sMonth := CONCAT(IN1 := '0', IN2 := #sMonth);
ELSE
VAL_STRG(IN := #stSystemTime.MONTH,
SIZE := 2,
PREC := 0,
FORMAT := 0,
P := 1,
OUT => #sMonth);
END_IF;
#sDay := '';
IF #stSystemTime.DAY < 10 THEN
VAL_STRG(IN := #stSystemTime.DAY,
SIZE := 1,
PREC := 0,
FORMAT := 0,
P := 1,
OUT => #sDay);
#sDay := CONCAT(IN1 := '0', IN2 := #sDay);
ELSE
VAL_STRG(IN := #stSystemTime.DAY,
SIZE := 2,
PREC := 0,
FORMAT := 0,
P := 1,
OUT => #sDay);
END_IF;
#sHour := '';
IF #stSystemTime.HOUR < 10 THEN
VAL_STRG(IN := #stSystemTime.HOUR,
SIZE := 1,
PREC := 0,
FORMAT := 0,
P := 1,
OUT => #sHour);
#sHour := CONCAT(IN1 := '0', IN2 := #sHour);
ELSE
VAL_STRG(IN := #stSystemTime.HOUR,
SIZE := 2,
PREC := 0,
FORMAT := 0,
P := 1,
OUT => #sHour);
END_IF;
#sMinute := '';
IF #stSystemTime.MINUTE < 10 THEN
VAL_STRG(IN := #stSystemTime.MINUTE,
SIZE := 1,
PREC := 0,
FORMAT := 0,
P := 1,
OUT => #sMinute);
#sMinute := CONCAT(IN1 := '0', IN2 := #sMinute);
ELSE
VAL_STRG(IN := #stSystemTime.MINUTE,
SIZE := 2,
PREC := 0,
FORMAT := 0,
P := 1,
OUT => #sMinute);
END_IF;
#sSecond := '';
IF #stSystemTime.SECOND < 10 THEN
VAL_STRG(IN := #stSystemTime.SECOND,
SIZE := 1,
PREC := 0,
FORMAT := 0,
P := 1,
OUT => #sSecond);
#sSecond := CONCAT(IN1 := '0', IN2 := #sSecond);
ELSE
VAL_STRG(IN := #stSystemTime.SECOND,
SIZE := 2,
PREC := 0,
FORMAT := 0,
P := 1,
OUT => #sSecond);
END_IF;
#sSystemTime := CONCAT(IN1 := #sYear, IN2 := '-');
#sSystemTime := CONCAT(IN1 := #sSystemTime, IN2 := #sMonth);
#sSystemTime := CONCAT(IN1 := #sSystemTime, IN2 := '-');
#sSystemTime := CONCAT(IN1 := #sSystemTime, IN2 := #sDay);
#sSystemTime := CONCAT(IN1 := #sSystemTime, IN2 := '-');
#sSystemTime := CONCAT(IN1 := #sSystemTime, IN2 := #sHour);
#sSystemTime := CONCAT(IN1 := #sSystemTime, IN2 := ':');
#sSystemTime := CONCAT(IN1 := #sSystemTime, IN2 := #sMinute);
#sSystemTime := CONCAT(IN1 := #sSystemTime, IN2 := ':');
#sSystemTime := CONCAT(IN1 := #sSystemTime, IN2 := #sSecond);
08-17
07-27
2万+
09-04
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交