当前位置:网站首页>博途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);边栏推荐
- [to.Net] C set class source code analysis
- Introduction to relevant processes and functions of wechat official account development
- Go语言高级
- Extensive reading of the paper [film: visual reasoning with a general condition layer]
- 赋能「新型中国企业」,SAP Process Automation 落地中国
- 【pytorch记录】自动混合精度训练 torch.cuda.amp
- Bao, what if the O & M 100+ server is a headache? Use Xingyun housekeeper!
- PostgreSQL varchar[] 数组类型操作
- Contos 7 搭建sftp之创建用户、用户组以及删除用户
- Dom4J解析XML、Xpath检索XML
猜你喜欢

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

测试自学人必看:软件测试如何找测试项目?
使用环信提供的uni-app Demo,快速实现一对一单聊

【pytorch记录】自动混合精度训练 torch.cuda.amp

商业智能BI开发和报表开发有什么本质区别?

nacos启动失败问题解决与总结

Lumiprobe free radical analysis h2dcfda instructions

Flutter 实战-快速实现音视频通话应用

Introduction to relevant processes and functions of wechat official account development

寶,運維100+服務器很頭疼怎麼辦?用行雲管家!
随机推荐
Write it down once Net travel management background CPU Explosion Analysis
云服务器ECS夏日省钱秘籍,这次@老用户快来领走
学习笔记【gumbel softmax】
More information about M91 fast hall measuring instrument
原生js打造日程表-支持鼠标滚轮滚动选择月份-可以移植到任何框架中
Facebook聊单,SaleSmartly有妙招!
Go语言高级
English语法_形容词/副词3级 -注意事项
如何正确使用Vertx操作Redis(3.9.4带源码分析)
uni-app微信小程序一键登录获取权限功能
新版国标GB28181视频平台EasyGBS如何配置WebRTC视频流格式播放?
Solidity - contract structure - error - ^0.8.4 NEW
AAAI2020: Real-time Scene Text Detection with Differentiable Binarization
Lean thinking: source, pillar, landing. I understand it after reading this article
Learning notes [Gumbel softmax]
Task: denial of service DOS
[go ~ 0 to 1] day 5 July 1 type alias, custom type, interface, package and initialization function
宝,运维100+服务器很头疼怎么办?用行云管家!
Lake Shore 连续流动低温恒温器传输线
DTD建模