Results 1 to 3 of 3

Thread: get date

  1. #1
    Join Date
    Aug 2009
    Posts
    38
    Thanks
    3

    Default get date

    Hi,

    I have a QCalendarWidget and when I select a date, I would like to get the date like : 16-02-10. But when I get the selectDate() it shows me: "mar 16 feb 2010".

    How could I do to get 16-02-10 instead "mar 16 feb 2010"??

    Many thanks and sorry for my english!

  2. #2
    Join Date
    Aug 2008
    Posts
    134
    Thanks
    10
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: get date

    selectedDate() returns you the QDate. There is a toString() function in QDate which returns you the date in the specified format. Hence you can use:
    Qt Code:
    1. selectedDate().toString("dd-mm-yy")
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to navi1084 for this useful post:

    KillGabio (12th February 2012)

  4. #3
    Join Date
    Aug 2009
    Posts
    38
    Thanks
    3

    Default Re: get date

    Many thanks!
    Is solved!!

Similar Threads

  1. SQL date queries
    By ^NyAw^ in forum Qt Programming
    Replies: 1
    Last Post: 11th April 2008, 10:41
  2. Date Time
    By starcontrol in forum Qt Programming
    Replies: 3
    Last Post: 4th April 2008, 11:02
  3. what is the release date of Qt-4.4
    By babu198649 in forum Installation and Deployment
    Replies: 1
    Last Post: 7th January 2008, 09:50
  4. date
    By AnithaRagupathy in forum Qt Programming
    Replies: 3
    Last Post: 2nd November 2007, 06:28
  5. How to default Date-Edit Widget to system date
    By JohnToddSr in forum Qt Tools
    Replies: 4
    Last Post: 17th January 2007, 19:18

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.