如何将显示时间设置为特定值

编程入门 行业动态 更新时间:2024-10-26 14:40:27
本文介绍了如何将显示时间设置为特定值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想将PC上的时间与外部源(PLC)同步。

I want to synchronize the time on my PC to an external source (a PLC).

从PLC中我得到的时间是YYYY,MM,DD,...... ,mm,ss。

From the PLC I get the time in YYYY, MM, DD, hh, mm, ss.

然后我想让PC显示同一时间。

Then I want to make the PC display the same time.

这是怎么做的?

我找到了一个命令SetDateTime - 但是在这里我进入了UTC和时区问题....

I found a command SetDateTime - but here I get into UTC and time zone issues....

我想要的只是让PC显示我来自PLC的时间!来自PLC的时间已经具有时区和夏令时信息,因此它是正确的时间!

All I want is simply make the PC display the time I have from the PLC! The time from the PLC already has the time zone and daylight saving information soit is the correct time as it is!

推荐答案

杰克,

在VBA使用格式函数中:

In VBA use format function:

格式(" 2015-10-07 12 :16:21"," YYYY,MM,DD,hh,mm,ss")

format("2015-10-07 12:16:21" ,"YYYY, MM, DD, hh, mm, ss")

对于计算机系统,更改区域格式日期和时间:

For computer system, change regional format date and time:

http://www.sysprobs / change-date-format-windows-7-ddmmyyyy

更多推荐

如何将显示时间设置为特定值

本文发布于:2023-11-12 01:27:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1580121.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:设置为   如何将   定值   时间

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!