Results 1 to 3 of 3

Thread: How to convert QDate::currentDate() format to dd/MM/yyyy format

  1. #1
    Join Date
    Jun 2011
    Posts
    26
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default How to convert QDate::currentDate() format to dd/MM/yyyy format

    Hello,
    I am new to Qt.Here is my code for date
    Date createDate;
    createdDate=QDate::currentDate();
    String createdDateString;
    createdDateString=createdDate.toString();

    the date format displayed is e.g today's date is Thru June 2 2011 but i want the date to be displayed as 02/06/2011. Please help me...
    Thanks in advance..

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,593
    Thanks
    13
    Thanked 1,587 Times in 1,516 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to convert QDate::currentDate() format to dd/MM/yyyy format

    Please read the manual for QDate::toString()

  3. #3
    Join Date
    Jun 2011
    Posts
    26
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: How to convert QDate::currentDate() format to dd/MM/yyyy format

    Yes i got it..Thank you Chris..

Similar Threads

  1. Regular Expression for QDate [YYYY/MM/DD] format
    By bera82 in forum Qt Programming
    Replies: 6
    Last Post: 3rd August 2019, 09:40
  2. How can i convert qstring to money format ?
    By newermind in forum Qt Programming
    Replies: 9
    Last Post: 17th April 2016, 22:19
  3. Replies: 1
    Last Post: 14th January 2011, 11:57
  4. cannot convert all images to PNG format ...
    By sh123 in forum Qt Programming
    Replies: 2
    Last Post: 21st March 2009, 13:04
  5. Replies: 7
    Last Post: 17th November 2007, 11:33

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.