标签:object 运行 scripting local utc creat cal 技术 输入
dim SWDT, datetime, utcTime Set SWDT = CreateObject("WbemScripting.SWbemDateTime") datetime = "2019-10-11 12:00:00" ‘本地时间转UTC时间 SWDT.SetVarDate datetime, True utcTime = SWDT.GetVarDate (False)
dim SWDT, datetime, localTime Set SWDT = CreateObject("WbemScripting.SWbemDateTime") datetime = "2019-10-11 12:00:00" ‘UTC时间转本地时间 SWDT.SetVarDate datetime, False localTime = SWDT.GetVarDate(True)
新建文本文件,写入以下代码,改后缀名为vbs。
dim SWDT, datetime, utcTime, localTime Set SWDT = CreateObject("WbemScripting.SWbemDateTime") datetime = "2019/10/11 12:00:00" ‘本地时间转UTC时间 SWDT.SetVarDate datetime, True utcTime = SWDT.GetVarDate (False) ‘UTC时间转本地时间 SWDT.SetVarDate datetime, False localTime = SWDT.GetVarDate(True) Wscript.Echo "输入时间:" & datetime & vbnewline & "UTC时间:"& utcTime & vbnewline & "本地时间:"& localTime & vbnewline
运行效果如下:
标签:object 运行 scripting local utc creat cal 技术 输入
原文地址:https://www.cnblogs.com/yada/p/11653228.html