VariantTimeToSystemTime

This function converts the variant representation of time to system time values.

At a Glance

Header file: Oleauto.h
Windows CE versions: 2.0 and later

Syntax

HRESULT VariantTimeToSystemTime(double vtime, LPSYSTEMTIME lpSystemTime);

Parameters

vtime

Specifies the variant time that will be converted.

lpSystemTime

Long pointer to the location where the converted time is stored.

Return Values

The return value obtained from the returned INT is one of the following.

Value Description
True Success.
False Failure.

Remarks

Passing into this function any invalid and, under some circumstances, NULL pointers will result in unexpected termination of the application.

A variant time is stored as an 8-byte real value (double), representing a date between January 1, 1753 and December 31, 2078, inclusive. The value 2.0 represents January 1, 1900; 3.0 represents January 2, 1900, and so on. Adding 1 to the value increments the date by a day. The fractional part of the value represents the time of day. Therefore, 2.5 represents noon on January 1, 1900; 3.25 represents 6:00 A.M. on January 2, 1900, and so on. Negative numbers represent the dates prior to December 30, 1899.

Using the SYSTEMTIME structure is useful because: