Export (0) Print
Expand All

WQL-Supported Date Formats

In addition to the WMI DATETIME format, the following date formats are supported for use in the WQL WHERE clause.

The displayed time format is different for different locales. Scripts that connect to remote computers must specify time in the format appropriate for the locale of the target computer.

For example, the United States date and time format is MM-DD-YYYY. If a script on a US computer connects to a target computer in a locale where the format is DD-MM-YYYY, then queries are processed on the target computer as DD-MM-YYYY. To avoid different results between locales, use the DATETIME format. For more information, see Date and Time Format.

FormatDescription
Mon[th] dd[,] [yy]yy

Month (either spelled-out or abbreviated in three letters), day, optional comma, and two or four-digit year.

January 21, 1932
January 21, 32
Jan 21 1932
Jan 21 32
Mon[th][,] yyyy

Month (either spelled-out or abbreviated in three letters), optional comma, and four-digit year.

January 1932
Jan 1932
Mon[th] [yy]yy dd

Month (either spelled-out or abbreviated in three letters), two or four digit year, and day.

January 1932 21
Jan 32 21
dd Mon[th][,][ ][yy]yy

Day of the month, month (either spelled-out or abbreviated in three letters), optional comma, optional space, and two or four-digit year.

21 January, 1932
21 Jan32
dd [yy]yy Mon[th]

Day of the month, two or four-digit year, and month (either spelled-out or abbreviated in three letters).

21 1932 January
[yy]yy Mon[th] dd

Two or four-digit year, month (either spelled-out or abbreviated in three letters), and day.

1932 January 21
yyyy Mon[th]

Two or four-digit year and month (either spelled-out or abbreviated in three letters).

1932 Jan
yyyy dd Mon[th]

Two or four-digit year, day, and month (either spelled-out or abbreviated in three letters).

1932 21 January
[M]M{/-.}dd{/-.}[yy]yy

Month, day, and two or four-digit year. Note that the separators must be the same.

dd{/-.}[M]M{/-.}[yy]yy

Day of the month, month, and two or four-digit year. Note that the separators must be the same.

[M]M{/-.}[yy]yy{/-.}dd

Month, two or four-digit year, and day. Note that the separators must be the same.

dd{/-.}[yy]yy{/-.}[M]M

Day of the month, two or four-digit year, and month. Note that the separators must be the same.

[yy]yy{/-.}dd{/-.}[M]M

Two or four digit year, day, and month. Note that the separators must be the same.

[yy]yy{/-.}[M]M{/-.}dd

Two or four digit year, month, and day. Note that the separators must be the same.

[yy]yyMMdd

Two or four digit year, month, and day, without spaces.

yyyy[MM[dd]]

Two or four digit year, optional month, and optional day, without spaces.

 

Related topics

WHERE Clause

 

 

Show:
© 2015 Microsoft