Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Minimum Date for QDateTimeEdit - I want min date to be 3000 BC or -3000
Qt 6.11 is out! See what's new in the release blog

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

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 1.9k Views 1 Watching
  • 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    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
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      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
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        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
        0
        • S Offline
          S Offline
          sportlover
          wrote on last edited by
          #4

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

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved