当前位置:网站首页>Botu V16 obtains the system time and converts it into a string
Botu V16 obtains the system time and converts it into a string
2022-07-01 19:36:00 【WX_ LW】
// Get system time
#nSystemTime := RD_SYS_T(#stSystemTime);
// Convert to string
#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);边栏推荐
- 赋能「新型中国企业」,SAP Process Automation 落地中国
- A brief understanding of white box encryption technology
- Solidity - 算术运算的截断模式(unchecked)与检查模式(checked)- 0.8.0新特性
- 正则表达式=Regex=regular expression
- 简版拼多多商品数据
- 学习笔记-JDBC连接数据库操作的步骤
- 寶,運維100+服務器很頭疼怎麼辦?用行雲管家!
- 【6.24-7.1】写作社区精彩技术博文回顾
- MySQl的基本使用
- [pytorch record] distributed training dataparallel and distributeddataparallel of the model
猜你喜欢

Dom4J解析XML、Xpath检索XML
![[go ~ 0 to 1] day 5 July 1 type alias, custom type, interface, package and initialization function](/img/1e/bed6a761f07c052e43b1e3b1701760.png)
[go ~ 0 to 1] day 5 July 1 type alias, custom type, interface, package and initialization function

MATLAB中subplot函数的使用

原生js打造日程表-支持鼠标滚轮滚动选择月份-可以移植到任何框架中

Instagram 为何从内容共享平台变成营销工具?独立站卖家如何利用该工具?

axure不显示元件库

118. 杨辉三角

EasyGBS网络不稳定情况下重复请求视频拉流问题的优化

Interview questions for audio and video positions in Dachang -- today's headline

大厂音视频职位面试题目--今日头条
随机推荐
A brief understanding of white box encryption technology
nacos启动失败问题解决与总结
SIP protocol of gb28181
Solidity - 合约结构 - 错误(error)- ^0.8.4版本新增
【无标题】
ffmpeg 错误码
MATLAB中subplot函数的使用
Nacos configuration file publishing failed, please check whether the parameters are correct solution
论文阅读【Learning to Discretely Compose Reasoning Module Networks for Video Captioning】
Instagram 为何从内容共享平台变成营销工具?独立站卖家如何利用该工具?
ubuntu14安装MySQL并配置root账户本地与远程访问
下载(导出)pdf模板文件(比如:审批单),报错:Invalid nested tag *** found, expected closing tag ***
Learn MySQL from scratch - database and data table operations
DTD建模
English grammar_ Adjective / adverb Level 3 - precautions
任务:拒绝服务DoS
What must be done in graduation season before going to Shanhai
正则表达式=Regex=regular expression
Solidity - 算术运算的截断模式(unchecked)与检查模式(checked)- 0.8.0新特性
直播HLS协议