当前位置:网站首页>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);
边栏推荐
- Werewolf killing strategy: do you think I'm easy to cheat? Who do we believe!
- Solidity - 合约结构 - 错误(error)- ^0.8.4版本新增
- 博途V16 获取系统时间转换成字符串
- Interview questions for audio and video positions in Dachang -- today's headline
- Write it down once Net travel management background CPU Explosion Analysis
- 案例分享:QinQ基本组网配置
- 【Go ~ 0到1 】 第五天 7月1 类型别名,自定义类型,接口,包与初始化函数
- 学习笔记【gumbel softmax】
- Actual combat of flutter - fast implementation of audio and video call application
- Instagram 为何从内容共享平台变成营销工具?独立站卖家如何利用该工具?
猜你喜欢
optaplanner学习笔记(一)案例Cloud balance
Solidity - 合约结构 - 错误(error)- ^0.8.4版本新增
Nacos configuration file publishing failed, please check whether the parameters are correct solution
Actual combat of flutter - fast implementation of audio and video call application
[go ~ 0 to 1] day 5 July 1 type alias, custom type, interface, package and initialization function
XML语法、约束
从零开始学 MySQL —数据库和数据表操作
GB28181之SIP协议
Crunch简介、安装,使用Crunch制作密码字典
Chaos engineering platform chaosblade box new heavy release
随机推荐
使用环信提供的uni-app Demo,快速实现一对一单聊
[English grammar] Unit1 articles, nouns, pronouns and numerals
Solution and summary of Nacos startup failure
智慧防疫系统为建筑工地复工复产提供安全保障
Solidity - truncated and checked modes of arithmetic operations - new features of 0.8.0
Solidity - 合约结构 - 错误(error)- ^0.8.4版本新增
H264 encoding profile & level control
Bao, what if the O & M 100+ server is a headache? Use Xingyun housekeeper!
What must be done in graduation season before going to Shanhai
torch.nn.functional.interpolate函数
白盒加密技术浅理解
uni-app商品分类
宝,运维100+服务器很头疼怎么办?用行云管家!
The difference between indexof and includes
win10下使用msys+vs2019编译ffmpeg源码
A brief understanding of white box encryption technology
如何正确使用Vertx操作Redis(3.9.4带源码分析)
Introduction and installation of crunch, and making password dictionary with crunch
记一次 .NET 差旅管理后台 CPU 爆高分析
703. The k-th element in the data flow