当前位置:网站首页>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);
边栏推荐
- 奔赴山海之前,毕业季一定要做的那些事情
- English语法_形容词/副词3级 -注意事项
- 简版拼多多商品数据
- Bao, what if the O & M 100+ server is a headache? Use Xingyun housekeeper!
- 音频编解码基础知识
- brpc理解
- H264 encoding profile & level control
- Les canaux de culture intensive s'efforcent de développer Fu Xin et Wei Shi jiajie pour organiser une conférence de formation sur les nouveaux produits
- 为什么一定要从DevOps走向BizDevOps?
- Ubuntu14 install MySQL and configure root account local and remote access
猜你喜欢
数字化转型企业成功的关键,用数据创造价值
Les canaux de culture intensive s'efforcent de développer Fu Xin et Wei Shi jiajie pour organiser une conférence de formation sur les nouveaux produits
微信公众号开发相关流程及功能介绍
Ubuntu14 install MySQL and configure root account local and remote access
Extensive reading of the paper [film: visual reasoning with a general condition layer]
Facebook聊单,SaleSmartly有妙招!
论文泛读【FiLM: Visual Reasoning with a General Conditioning Layer】
正则表达式=Regex=regular expression
Introduction to relevant processes and functions of wechat official account development
Solidity - truncated and checked modes of arithmetic operations - new features of 0.8.0
随机推荐
见证时代!“人玑协同 未来已来”2022弘玑生态伙伴大会开启直播预约
直播HLS协议
[English grammar] Unit1 articles, nouns, pronouns and numerals
奔赴山海之前,毕业季一定要做的那些事情
精耕渠道共谋发展 福昕携手伟仕佳杰开展新产品培训大会
Interview questions for audio and video positions in Dachang -- today's headline
PostgreSQL varchar[] array type operation
The use of subplot function in MATLAB
[info() method in org.slf4j.logger]
Write it down once Net travel management background CPU Explosion Analysis
Learning records of building thingsboard, an Internet of things platform
AAAI2020: Real-time Scene Text Detection with Differentiable Binarization
Interview question 16.16 Partial sorting - Double finger needling
241. Different Ways to Add Parentheses
ffmpeg 错误码
Opencv video quality diagnosis - VIDEO occlusion diagnosis
CMU AI PhD 第一年总结
Introduction and installation of crunch, and making password dictionary with crunch
【Go ~ 0到1 】 第五天 7月1 类型别名,自定义类型,接口,包与初始化函数
Bao, what if the O & M 100+ server is a headache? Use Xingyun housekeeper!