Results 1 to 5 of 5

Thread: QTime and QDate from String

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,540
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanked 284 Times in 279 Posts

    Default Re: QTime and QDate from String

    Because time is not a part of date ? Try this :
    Qt Code:
    1. QDate myDate = QDateTime::fromString(qStr,"yyyy-MM-dd HH:mm:ss").date();
    To copy to clipboard, switch view to plain text mode 

  2. The following user says thank you to Lesiok for this useful post:

    Eleasar (11th February 2014)

  3. #2
    Join Date
    Feb 2014
    Posts
    7
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11
    Thanks
    1

    Default Re: QTime and QDate from String

    Done, Thank you

  4. #3
    Join Date
    May 2014
    Posts
    1
    Qt products
    Qt5

    Default Re: QTime and QDate from String

    hi everyone,
    i have been coding hotel management system and i would like to do something like this. in one lineedit it will be written check-in date which ı can do it and when i will write number of nights program will write automatically check-out date. i am waiting for your help.
    thank you

  5. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: QTime and QDate from String


Similar Threads

  1. QTime
    By dragon in forum Newbie
    Replies: 12
    Last Post: 16th February 2012, 10:40
  2. Help me qtime in qt?
    By tamnv110 in forum Newbie
    Replies: 7
    Last Post: 16th June 2011, 11:59
  3. QTime
    By bismitapadhy in forum Qt Programming
    Replies: 1
    Last Post: 26th June 2009, 05:21
  4. Getting QDate from string
    By yagabey in forum Qt Programming
    Replies: 10
    Last Post: 17th February 2009, 15:40
  5. Extending QDate, QTime and QDateTime
    By jamadagni in forum Qt Programming
    Replies: 8
    Last Post: 24th March 2006, 15:51

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
  •  
Qt is a trademark of The Qt Company.