Compartilhar via


VariantTimeToSystemTime (Windows CE 5.0)

Send Feedback

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

int VariantTimeToSystemTime(doublevtime,LPSYSTEMTIMElpSystemTime );

Parameters

  • vtime
    [in] Specifies the variant time that will be converted.
  • lpSystemTime
    [out] Long pointer to the location where the converted time is stored.

Return Values

A non-zero value if the variant was successfully converted to a system time, zero otherwise.

Remarks

Passing invalid (and under some circumstances NULL) pointers to this function causes an 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 for these reasons:

  • It spans all time/date periods. MS-DOS date/time is limited to representing only those dates between 1/1/1980 and 12/31/2107.
  • The date/time elements are all easily accessible without needing to do bit decoding.
  • The National Language Support data and time formatting functions GetDateFormat and GetTimeFormat take a SYSTEMTIME value as input.
  • It is the default Win32 time and date data format supported by Windows NT and Windows 95.

Requirements

OS Versions: Windows CE 2.0 and later.
Header: Oleauto.h.
Link Library: Oleaut32.lib.

See Also

Automation Functions | SYSTEMTIME | GetDateFormat | GetTimeFormat

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.