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. QDate Format Conversion
Qt 6.11 is out! See what's new in the release blog

QDate Format Conversion

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.0k 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.
  • R Offline
    R Offline
    root0x
    wrote on last edited by
    #1

    Hi, im creating an entry form and one of the fields is a date edit box, the problem is that the data is going to be inputed into a SQLITE database which requires the YYYY-MM-DD format but i really want to keep the DD-MM-YYYY format in the date edit box, could someone please tell me how to convert date formats.

    Thank you

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Isn't QDateEdit's "displayFormat":http://doc.qt.io/qt-5/qdatetimeedit.html#displayFormat-prop what you are looking for ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • R Offline
        R Offline
        root0x
        wrote on last edited by
        #3

        I want to keep the display format to be DD-MM-YYYY but i would like it to store the date as YYYY-MM-DD

        Thank you

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          I understood, that's what displayFormat is for

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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