PRB: VariantTimeToSystemTime and SystemTimeToVariantTime Functions Ignore Milliseconds Value of System Time (297463)
The information in this article applies to:
- Microsoft Win32 Software Development Kit (SDK) 4.0
This article was previously published under Q297463 SYMPTOMS
When you use the VariantTimeToSystemTime function to convert variant time to system time and the SystemTimeToVariantTime function to convert system time to variant time, the milliseconds value appears as zero or is ignored.
CAUSESystemTimeToVariantTime (which uses the VarUdateFromDate function) and VariantTimeToSystemTime (which uses the VarDateFromUdate function) are not resolute up to milliseconds.
RESOLUTION
Do not use SystemTimeToVariantTime, VariantTimeToSystemTime, VarUdateFromDate, or VarDateFromUdate if you require millisecond resolution.
Beginning with Microsoft Windows NT 4.0 Service Pack 4 (SP4), Windows 95 with Distributed Component Object Model (DCOM) 1.2, and Windows 98, Automation now supports passing user-defined types (UDTs) in variants and safearrays of user-defined types as arguments to methods. This allows methods to return UDTs and allows programmers of Automation controllers (Automation clients) to call methods that require pointers to structures.
As an alternative to using the above-mentioned functions, you can wrap the SYSTEMTIME structure to a user and pass the user-defined data type to automation interfaces.
For more information on user-defined data types, see the following Microsoft Web site:
STATUS
This behavior is by design.
Modification Type: | Major | Last Reviewed: | 7/18/2001 |
---|
Keywords: | kbAPI kbDSupport kbinfo kbprb KB297463 |
---|
|