I
Ian Harding
This is a problem present using Visual Studio 2005, but not in Visual
Studio 2003 or Visual C++ 6.
COleDateTime modernDate( 1900, 1, 1, 0, 1, 0 );
COleDateTime problemDate( 1753, 1, 1, 0, 1, 0 );
CString isoDate = modernDate.Format(_T("%Y-%m-%dT%H:%M:%S"));
isoDate = problemDate.Format(_T("%Y-%m-%dT%H:%M:%S")); // problem!
problemDate.Format triggers an assertion failure on line 783 of strftime.c:
_VALIDATE_RETURN( ( timeptr->tm_year >=0 ), EINVAL, FALSE)
So any date where the year is earlier than 1900 will result in
timeptr->tm_year containing a negative value and fail the assertion on
line 783 of strftime.c if %Y is requested in the format string.
Is this a bug, or am I missing something?
Thanks,
Ian
Studio 2003 or Visual C++ 6.
COleDateTime modernDate( 1900, 1, 1, 0, 1, 0 );
COleDateTime problemDate( 1753, 1, 1, 0, 1, 0 );
CString isoDate = modernDate.Format(_T("%Y-%m-%dT%H:%M:%S"));
isoDate = problemDate.Format(_T("%Y-%m-%dT%H:%M:%S")); // problem!
problemDate.Format triggers an assertion failure on line 783 of strftime.c:
_VALIDATE_RETURN( ( timeptr->tm_year >=0 ), EINVAL, FALSE)
So any date where the year is earlier than 1900 will result in
timeptr->tm_year containing a negative value and fail the assertion on
line 783 of strftime.c if %Y is requested in the format string.
Is this a bug, or am I missing something?
Thanks,
Ian