Description
Reports the Universal Time Coordinate (UTC) time on a computer.
Script Code
Copy Code code as follows:
var wbemflagreturnimmediately = 0x10;
var wbemflagforwardonly = 0x20;
var objWMIService = GetObject ("winmgmts:\\\\.\\root\\cimv2");
var colitems = objWMIService.ExecQuery ("SELECT * from Win32_UTCTime", "WQL",
wbemflagreturnimmediately | wbemFlagForwardOnly);
var enumitems = new Enumerator (colitems);
for (;!enumitems.atend (); Enumitems.movenext ()) {
var objitem = Enumitems.item ();
WScript.Echo ("Day:" + objitem.day);
WScript.Echo ("Day of Week:" + 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 ("Week in Month:" + objitem.weekinmonth);
WScript.Echo ("Year:" + objitem.year);
WScript.Echo ();
}