VBS實(shí)現(xiàn)將當(dāng)前時(shí)間轉(zhuǎn)換成UTC時(shí)間
例如下面的代碼在當(dāng)前時(shí)間返回: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 Syntax End With ' Calculate and display the result WScript.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 1 End Sub
以上所述就是本文的全部?jī)?nèi)容了,希望大家能夠喜歡。
- 用vbscript實(shí)現(xiàn)修改屏幕保護(hù)的等待時(shí)間長(zhǎng)度
- 將WMI中的DateTime類型轉(zhuǎn)換成VBS時(shí)間的函數(shù)代碼
- 用VBS修改(設(shè)置)系統(tǒng)時(shí)間和日期的代碼
- 校準(zhǔn)系統(tǒng)時(shí)間的VBS代碼
- VBS中獲取系統(tǒng)本次及上次開關(guān)機(jī)時(shí)間的代碼(WinXP/win2003/Win7兼容版)
- vbscript實(shí)現(xiàn)的根據(jù)不同時(shí)間段顯示不同的歡迎語
- vbs獲取當(dāng)前時(shí)間日期的代碼
- vbscript獲取文件的創(chuàng)建時(shí)間、最后修改時(shí)間和最后訪問時(shí)間的方法
- VBS顯示當(dāng)前標(biāo)準(zhǔn)時(shí)間
相關(guān)文章
vbs實(shí)現(xiàn)恢復(fù)暫停的自動(dòng)啟動(dòng)服務(wù)的腳本
有時(shí)候我們需要把自啟動(dòng)的服務(wù)停掉,方便我們處理事務(wù),但我們?nèi)绻淮瓮5舻淖詥?dòng)服務(wù)比較多,如何一次性啟動(dòng)他們呢2008-06-06用VBS模擬實(shí)現(xiàn)PHP的sha1_file函數(shù)效果代碼
用VBS模擬實(shí)現(xiàn)PHP的sha1_file函數(shù)效果代碼,需要的朋友可以參考下。2011-01-01ActiveX部件不能創(chuàng)建對(duì)象:dm.dmsoft代碼:800A01AD
vbs調(diào)用插件報(bào):ActiveX部件不能創(chuàng)建對(duì)象,代碼:800A01AD,一般是因?yàn)椴《緦?dǎo)致dll文件丟失或者64系統(tǒng)問題導(dǎo)致,需要的朋友可以參考下2019-12-12利用vbs腳本實(shí)現(xiàn)設(shè)置IE的打印頁眉頁腳信息
這篇文章主要為大家分享下通過vbs腳本實(shí)現(xiàn)設(shè)置IE的打印頁眉頁腳信息的代碼,需要的朋友可以參考下2007-02-02VBS教程:函數(shù)-DateSerial 函數(shù)
VBS教程:函數(shù)-DateSerial 函數(shù)...2006-11-11WMI StdRegProv 通過wmi操作注冊(cè)表的vbscript實(shí)現(xiàn)代碼 (本地或遠(yuǎn)程)
WMI StdRegProv 通過wmi操作注冊(cè)表的vbscript實(shí)現(xiàn)代碼 (本地或遠(yuǎn)程),需要的朋友可以參考下。2011-12-12VBS基礎(chǔ)篇 - vbscript動(dòng)態(tài)數(shù)組
VBS中的動(dòng)態(tài)數(shù)組需要使用System.Collections.ArrayList,需要的朋友可以參考下2018-05-05