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. [SOLVED] Get full date using QDate::currentDate()
Qt 6.11 is out! See what's new in the release blog

[SOLVED] Get full date using QDate::currentDate()

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

    Hey everybody!

          I'm using 
    

    @QString s = QDate::currentDate().toString();@

    to get the current system date. However, the string returned has the shortened version of the current day. That is, it returns 'Mon' for 'Monday', 'Wed' for 'Wednesday' etc. How do get the function to return the full day name and not it's short form.

    Thanks.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Code_ReaQtor
      wrote on last edited by
      #2

      You might have used the wrong format for the output string.

      Take a look at "this":http://doc-snapshot.qt-project.org/4.8/qdate.html#toString

      use "dddd" instead of "ddd" to output the QDate::longDayName().

      Please visit my open-source projects at https://github.com/Code-ReaQtor.

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        "dddd" sure worked. Thank you very much Code_ReaQtor

        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