Help Center

WmiDateToStrfunction

Converts a date and time value in the CIM DATETIME format to a string containing the date based on the specified mask, e.g. "dd-MM-yyyy".

COMfunctionCWmiDisp.incdoc-orphan
No implementation located. This member is documented, but the source scan found no matching declaration. It is likely declared in a header this scan does not resolve, or provided by a macro.

Syntax

FUNCTION WmiDateToStr (BYVAL pwszDateTime AS WSTRING PTR, BYREF wszMask AS WSTRING, BYVAL bIsLocal AS BOOLEAN = TRUE) AS DWSTRING

Parameters

NameDescription
pwszDateTimeThe date and time value in the CIM DATETIME format.
wszMaskA picture string that is used to form the date.
bIsLocalIndicates whether the returned value is interpreted as local time. The UTC property then contains the local time converted to the correct Coordinated Universal Times (UTC) offset. If the value is FALSE, then the value is interpreted as UTC with a zero (0) offset.

Return value

The formatted date as a string.

Description

Converts a date and time value in the CIM DATETIME format to a string containing the date based on the specified mask, e.g. "dd-MM-yyyy".

The format types "d", and "y" must be lowercase and the letter "M" must be uppercase.

For example, to get the date string "Wed, Aug 31 94", the application uses the picture string "ddd',' MMM dd yy".

The following table defines the format types used to represent days:

The following table defines the format types used to represent months:

The following table defines the format types used to represent years:

Reference