FIX: Negative Value Passed to mktime() Generates Wrong Date (130769)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Professional Edition 2.0
- Microsoft Visual C++, 32-bit Professional Edition 2.1
This article was previously published under Q130769 SYMPTOMS
The wrong date is returned when a negative value is passed for the month
to the mktime() function.
For example, in the sample code in this article, -1 is passed for the
month, so the mktime() function should return December 15, 1994. However,
it incorrectly returns January 16, 1995.
RESOLUTION
Verify that the value for the month is greater than or equal to zero,
when calling the mktime() function.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This bug was corrected in Microsoft
Visual C++, 32-bit Edition, version 4.0.
Modification Type: | Minor | Last Reviewed: | 7/5/2005 |
---|
Keywords: | kbbug kbCompiler kbfix kbList KB130769 |
---|
|