Given the following code:
QDate test
( 2009,
2,
10 );
qDebug
( ) << test.
toJulianDay( ) <<
" " <<
QDate::fromJulianDay( 41 );
QDate test( 2009, 2, 10 );
qDebug( ) << test.toJulianDay( ) << " " << QDate::fromJulianDay( 41 );
To copy to clipboard, switch view to plain text mode
I would expect the results to be:
41 QDate( "Sat Feb 10 -4713" )
Instead I get the results
2452873 QDate( "Sun Feb 11 -4713" )
I know this result is not correct and I have submitted a bug to the Trolls (or is it Nokias now?). Here is a quick workaround, if you know the Julian Day:
QDate test
( 2009,
1,
1 );
test = test.addDays( julianDate - 1 );
QDate test( 2009, 1, 1 );
test = test.addDays( julianDate - 1 );
To copy to clipboard, switch view to plain text mode
Bookmarks