欢迎来到福编程网,本站提供各种互联网专业知识!

List the UTC Time on a Computer

发布时间:2007-06-11 作者: 来源:转载
DescriptionReportstheUniversalTimeCoordinate(UTC)timeonacomputer.ScriptCode复制代码代码如下:varwbemFlagReturnImmediately=0x10;varwbemFlagForwardOnly=0x20;varobjWMIService=GetObject("winmgmts:\\\\.\\root\\CIMV2");varcolItems=objWMI
Description
ReportstheUniversalTimeCoordinate(UTC)timeonacomputer.

ScriptCode
复制代码 代码如下:
varwbemFlagReturnImmediately=0x10;
varwbemFlagForwardOnly=0x20;

varobjWMIService=GetObject("winmgmts:.rootCIMV2");
varcolItems=objWMIService.ExecQuery("SELECT*FROMWin32_UTCTime","WQL",
wbemFlagReturnImmediately|wbemFlagForwardOnly);

varenumItems=newEnumerator(colItems);
for(;!enumItems.atEnd();enumItems.moveNext()){
varobjItem=enumItems.item();

WScript.Echo("Day:"+objItem.Day);
WScript.Echo("DayOfWeek:"+objItem.DayOfWeek);
WScript.Echo("Hour:"+objItem.Hour);
WScript.Echo("Milliseconds:"+objItem.Milliseconds);
WScript.Echo("Minute:"+objItem.Minute);
WScript.Echo("Month:"+objItem.Month);
WScript.Echo("Quarter:"+objItem.Quarter);
WScript.Echo("Second:"+objItem.Second);
WScript.Echo("WeekInMonth:"+objItem.WeekInMonth);
WScript.Echo("Year:"+objItem.Year);
WScript.Echo();
}

相关推荐