List the UTC Time on a Computer
List the UTC Time on a Computer
发布时间:2016-12-30 来源:查字典编辑
摘要:DescriptionReportstheUniversalTimeCoordinate(UTC)timeonacomputer.Scrip...

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();

}

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新Javascript教程学习
热门Javascript教程学习
编程开发子分类