Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Minimum Date for QDateTimeEdit - I want min date to be 3000 BC or -3000

    General and Desktop
    3
    4
    1399
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      blissful last edited by

      Hi
      I'm trying to change the min date to the earliest date possible but Qt currently restricts me to 9/14/52 12:00:00 AM.
      If possible, I would like for the minimum date to be some date around -3000 or 3000 BC.
      Is this possible?
      If not, at the very least I'd like to be have minimum year of 0.

      How can I achieve this?
      Thank you.

      1 Reply Last reply Reply Quote 0
      • K
        koahnig last edited by

        welcome to devnet

        Did you check out the "documentation of QDate? ":http://qt-project.org/doc/qt-4.8/qdate.html#range-of-valid-dates

        No year number zero is existing "(see also)":http://en.wikipedia.org/wiki/Before_Christ#No_year_zero .

        This is probably the reason to limit the date range.

        Vote the answer(s) that helped you to solve your issue(s)

        1 Reply Last reply Reply Quote 0
        • B
          blissful last edited by

          Hi
          Yes you are right abt year "0".
          QDate goes far back..."The range of valid dates is from January 2nd, 4713 BCE, to sometime in the year 11 million CE.".

          But even then, I still can't set QDateTimeEdit to use dates as far back as January 2nd, 4713 BCE as the min date for QDateTimeEdit is
          " The minimum date must be at least the first day in year 100, otherwise setMinimumDate() has no effect."

          O well...I guess I have to settle for an alternative.
          Thank you very much.

          1 Reply Last reply Reply Quote 0
          • S
            sportlover last edited by

            If you really want to, you can extend the class and override the required classes.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post