Events
Apr 8, 3 PM - May 28, 7 AM
Sharpen your AI skills and enter the sweepstakes to win a free Certification exam
Register now!This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Converts a system time to a variant representation.
INT SystemTimeToVariantTime(
[in] LPSYSTEMTIME lpSystemTime,
[out] DOUBLE *pvtime
);
[in] lpSystemTime
The system time.
[out] pvtime
The variant time.
The function returns TRUE on success and FALSE otherwise.
A variant time is stored as an 8-byte real value (double), representing a date between January 1, 1900 and December 31, 9999, 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 dates prior to December 30, 1899.
The variant time resolves to one second. Any milliseconds in the input date are ignored.
Note
When working with variant time, be mindful of the additional day added in leap years, which might produce unexpected results if unhandled. For more information, see leap year readiness.
The SYSTEMTIME structure is useful for the following reasons:
Requirement | Value |
---|---|
Target Platform | Windows |
Header | oleauto.h |
Library | OleAut32.lib |
DLL | OleAut32.dll |
Events
Apr 8, 3 PM - May 28, 7 AM
Sharpen your AI skills and enter the sweepstakes to win a free Certification exam
Register now!