View Full Version : Minimum date change

16th August 2006, 22:01
Is there a way to change the minimum date for QDateEdit? I am building a database of all my music scores and books. A lot of the composer's birth and death dates are before 1752, the current minumum. Would I have to edit the qdatetimeedit.cpp and .h files and then recompile QT? I hope not, I don't really feel comfortable doing that, but if need be, I will.

Thanks in advance for any advice.


16th August 2006, 22:15
As the docs say:
Note that QDate should not be used for date calculations for dates prior to the introduction of the Gregorian calendar. This calendar was adopted by England from the 14 September 1752 (hence this is the earliest valid QDate), and subsequently by most other Western countries, by 1923. The latest valid date within this scheme is 31 December 7999.
You will have to implement your own QDate (or change Qt sources).

See this:
but beware that there is a difference between time used by astronomers and historians.

16th August 2006, 22:22
I did see that post, I don't need to go that far back in time. I guess I could always create a QLineEdit with a validator of something like MM/DD/YYYY. That would probably be better. Because who knows when leap years and all that crap were back in J.S. Bach's day. Did they even have leap year back then? Oh well.

Thanks a million folks.