当前位置:网站首页>博途V16 获取系统时间转换成字符串
博途V16 获取系统时间转换成字符串
2022-07-01 18:45:00 【WX_LW】
//获取系统时间
#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);边栏推荐
- [English grammar] Unit1 articles, nouns, pronouns and numerals
- Transform + ASM data
- DTD建模
- 论文阅读【Discriminative Latent Semantic Graph for Video Captioning】
- The intelligent epidemic prevention system provides safety guarantee for the resumption of work and production at the construction site
- Dom4J解析XML、Xpath检索XML
- Detailed explanation of JUnit unit test framework
- Case sharing: basic networking configuration of QinQ
- ffmpeg常用命令(二)
- ECS summer money saving secret, this time @ old users come and take it away
猜你喜欢

ECS summer money saving secret, this time @ old users come and take it away

The intelligent epidemic prevention system provides safety guarantee for the resumption of work and production at the construction site

uni-app微信小程序一键登录获取权限功能

The use of subplot function in MATLAB

混沌工程平台 ChaosBlade-Box 新版重磅发布

研究了11种实时聊天软件,我发现都具备这些功能…

Superoptimag superconducting magnet system - SOM, Som2 series

见证时代!“人玑协同 未来已来”2022弘玑生态伙伴大会开启直播预约

Enabling "new Chinese enterprises", SAP process automation landing in China

Lumiprobe phosphide hexaethylene phosphide specification
随机推荐
PostgreSQL varchar[] 数组类型操作
简版拼多多商品数据
寶,運維100+服務器很頭疼怎麼辦?用行雲管家!
奔赴山海之前,毕业季一定要做的那些事情
Helium transmission line of lake shore cryostat
The difference between indexof and includes
Flutter 实战-快速实现音视频通话应用
The use of subplot function in MATLAB
Contos 7 搭建sftp之创建用户、用户组以及删除用户
Learning records of building thingsboard, an Internet of things platform
Lake Shore continuous flow cryostat transmission line
M91 fast hall measuring instrument - better measurement in a shorter time
[English grammar] Unit1 articles, nouns, pronouns and numerals
uni-app商品分类
Detailed explanation of JUnit unit test framework
Manufacturing SRM management system supplier all-round closed-loop management, to achieve procurement sourcing and process efficient collaboration
Go Language Advanced
CMU AI PhD 第一年总结
【org.slf4j.Logger中info()方法】
How to solve the problem of splash screen when the main and sub code streams of easygbs are h.265?