Results 1 to 4 of 4

Thread: date

  1. #1
    Join Date
    Oct 2007
    Posts
    21
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default date

    hi i m an beginner bear with me.
    i m getting a date as qstring.
    I need to get the day,month and year alone from this date which is QString.
    and then want to display in a particular format like yr-month-day
    thanks

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: date

    J-P Nurmi

  3. #3
    Join Date
    Oct 2007
    Posts
    21
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default date

    hi i m passing a date in 20/10/2007 format and
    if i give
    QDate datee = QDate::fromString(pi_date, "yyyy/MM/dd");
    to convert it to date
    and if try to get year of that date like
    quint32 Yearr=datee.year();
    .I m getting some junk value as my year while executing.
    Wt s the prob with the above code.

  4. #4
    Join Date
    Jan 2007
    Posts
    177
    Thanks
    8
    Thanked 10 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: date

    QDate datee = QDate::fromString(pi_date, dd/MM/yyyy");

Similar Threads

  1. How to set Creation date for file...
    By santosh.kumar in forum Qt Programming
    Replies: 10
    Last Post: 12th October 2007, 17:50
  2. to set date and time in the file info of two days back
    By thomasjoy in forum Qt Programming
    Replies: 1
    Last Post: 11th October 2007, 16:54
  3. Replies: 7
    Last Post: 15th April 2007, 01:39
  4. Localizing date times in item views
    By jpn in forum Qt Programming
    Replies: 6
    Last Post: 6th February 2007, 14:47
  5. Working with Date type in database applications
    By kolach in forum Qt Programming
    Replies: 13
    Last Post: 25th January 2006, 14:20

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.