Compartilhar via


Win32_UTCTime class

The Win32_UTCTimeWMI class describes a point in time that is returned as Win32_UTCTime objects that result from a query. These are returned as the value for the TargetInstance property in the __InstanceModificationEvent system class. The Hour property is returned as the Coordinated Universal Time (UTC) time on a 24 hour clock.

Note

The smallest time segment supported is a second.

The following syntax is simplified from Managed Object Format (MOF) code and includes all of the inherited properties. Properties and methods are in alphabetic order, not MOF order.

Syntax

[dynamic, provider("Win32ClockProvider"), AMENDMENT]
class Win32_UTCTime : Win32_CurrentTime
{
  uint32 Day;
  uint32 DayOfWeek;
  uint32 Hour;
  uint32 Milliseconds;
  uint32 Minute;
  uint32 Month;
  uint32 Quarter;
  uint32 Second;
  uint32 WeekInMonth;
  uint32 Year;
};

Members

The Win32_UTCTime class has these types of members:

Properties

The Win32_UTCTime class has these properties.

Day

Data type: uint32

Access type: Read-only

Current day that matches the query (1 31).

This property is inherited from Win32_CurrentTime.

DayOfWeek

Data type: uint32

Access type: Read-only

Current day of the current week that matches the query (0 6). By convention, the value 0 (zero) is always Sunday, regardless of the culture or the locale set on the machine.

This property is inherited from Win32_CurrentTime.

Hour

Data type: uint32

Access type: Read-only

Current hour of the current day (0 23).

This property is inherited from Win32_CurrentTime.

Milliseconds

Data type: uint32

Access type: Read-only

Not implemented.

This property is inherited from Win32_CurrentTime.

Minute

Data type: uint32

Access type: Read-only

Current minute (0 59).

This property is inherited from Win32_CurrentTime.

Month

Data type: uint32

Access type: Read-only

Current month that matches the query (1 12).

This property is inherited from Win32_CurrentTime.

Quarter

Data type: uint32

Access type: Read-only

Current quarter of the current year (1 4).

This property is inherited from Win32_CurrentTime.

Second

Data type: uint32

Access type: Read-only

Current second of the current minute (0 59).

This property is inherited from Win32_CurrentTime.

WeekInMonth

Data type: uint32

Access type: Read-only

Current week in the current month (1 6).

This property is inherited from Win32_CurrentTime.

Year

Data type: uint32

Access type: Read-only

Current year matching the query (4 digits).

This property is inherited from Win32_CurrentTime.

Remarks

When you subscribe to events by using this class, you can create sophisticated schedules that can be implemented through events returned from WMI. For example, you can subscribe to an event for a specific day of the week in a specific quarter of a specific year. However, for schedules, the Win32_LocalTime class is more commonly used unless UTC time is required.

The following query example shows you how to generate an event every Friday morning at 8:00:00 (UTC time) during the entire year of 2001. However, if the line "AND TargetInstance.Second=0" is removed, then the query generates 60 notifications between 8:00:00 and 8:01:00, every Friday morning in 2001.

SELECT * FROM __InstanceModificationEvent
WHERE
    TargetInstance ISA "Win32_UTCTime" 
    AND TargetInstance.Year = 2001 
    AND TargetInstance.DayOfWeek=5 
    AND TargetInstance.Hour=8 
    AND TargetInstance.Minute=0 
    AND TargetInstance.Second=0

The following query example shows you how to generate events every second forever.

SELECT * FROM __InstanceModificationEvent
WHERE
    TargetInstance ISA "Win32_UTCTime"

Requirements

Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008
Namespace
Root\CIMV2
MOF
Wmitimep.mof
DLL
Wmitimep.dll

See also

Operating System Classes

Creating a Timer Event with Win32_LocalTime or Win32_UTCTime

Win32_LocalTime

Win32_CurrentTime