随机更改计算机名时间vbs,VBS实现将当前时间转换成UTC时间 -电脑资料

这篇文章主要介绍了VBS实现将当前时间转换成UTC时间,十分的简单实用,需要的朋友可以参考下

例如下面的代码在当前时间返回:1368299689

Option Explicit Dim dtmDate If WScript.Arguments.Named.Count > 0 Then Syntax With WScript.Arguments.Unnamed ‘ Check command line arguments If .Count = 0 Then dtmDate = Now If .Count > 0 Then dtmDate = .Item(0) If .Count > 1 Then dtmDate = dtmDate & " " & .Item(1) If .Count > 2 Then dtmDate = dtmDate & " " & .Item(2) If .Count > 3 Then Syntax On Error Resume Next dtmDate = CDate( dtmDate ) If Err Then On Error Goto 0 Syntax End If On Error Goto 0 If Not IsDate( dtmDate ) Then SyntaxEnd With ‘ Calculate and display the resultWScript.Echo DateDiff( "s", "1970-01-01 00:00:00", dtmDate ) Sub Syntax WScript.Echo vbcrlf _ & "Date2UTC.vbs, Version 1.00" _ & vbCrLf _ & "Convert any date/time to Unix time (UTC)" _ & vbCrLf & vbCrLf _ & "Usage: CSCRIPT.EXE //NoLogo Date2UTC.vbs date [ time ]" _ & vbCrLf & vbCrLf _ & "Where: ""date"" is the date to convert (default: current date/time)" _ & vbCrLf _ & " ""time"" is the optional time to convert" _ & vbCrLf & vbCrLf _ & "Notes: Though often called UTC, Unix time does not take into account leap" _ & vbCrLf _ & " seconds, while ""official"" UTC does." _ & vbCrLf _ & " If the specified date is ambiguous, the current user‘s date" _ & vbCrLf _ & " and time format is assumed." _ & vbCrLf & vbCrLf _ & "Written by Rob van der Woude" _ & vbCrLf _ & "http://www.robvanderwoude.com" WScript.Quit 1End Sub

以上所述就是本文的全部内容了,希望大家能够喜欢,VBS实现将当前时间转换成UTC时间》(https://www.unjs.com)。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值