当前位置: 主页 > PLC控制

Function SQLTimeFormat(UTCTime)解释一下这个函数

FunctionSQLTimeFormat(UTCTime)
SQLTimeFormat=Year(UTCTime)&"-"&Right("00"&Month(UTCTime),2)
SQLTimeFormat=SQLTimeFormat&"-"&Right("00"&DAy(UTCTime),2)
SQLTimeFormat=SQLTimeFormat&""&Right("00"&Hour(UTCTime),2)
SQLTimeFormat=SQLTimeFormat&":"&Right("00"&Minute(UTCTime),2)
SQLTimeFormat=SQLTimeFormat&":"&Right("00"&Second(UTCTime),2)
EndFunction
其中Right("00"&Month(UTCTime),2)"00"什么意思?最好能举个例子,谢谢!

最佳答案

月取两个字符,“00”表示的显示格式
比如当前是7月,如果直接取月份的话就是7,用“00”格式的取月就是07.

提问者于答案的评价:
谢谢!

  • 关注微信

猜你喜欢

微信公众号