Results 1 to 8 of 8

Thread: other time...can't get date

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Wiki edits
    5

    Default Re: other time...can't get date

    ok, first
    Qt Code:
    1. QString pepelu = lineaHora.left(6)+lineaHora.right(5);
    2. QDateTime dias = QDateTime::fromString(pepelu,"yyMMddhhmm");
    To copy to clipboard, switch view to plain text mode 
    6+5 = 11. yyMMddhhmm == 10! I think.

    Then in the while loop you set the result every time on the same label. And I guess your last line which is precessed in an empty line. So the label will show nothing.

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

    Default Re: other time...can't get date

    Well, is something strange
    The file have:

    100303-0900
    100303-1015
    100303-1400
    100303-1430

    If I do:

    QMessageBox::information(this, "resultado",lineaHora.right(6))

    Gives me -1400

    QMessageBox::information(this, "resultado",lineaHora.right(5))

    Gives me 1400 when I think that if would give me: "-1400"

    Many thanks and sorry for my english!

  3. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Wiki edits
    5

    Default Re: other time...can't get date

    Quote Originally Posted by mmm286 View Post
    If I do:

    QMessageBox::information(this, "resultado",lineaHora.right(6))

    Gives me -1400

    QMessageBox::information(this, "resultado",lineaHora.right(5))

    Gives me 1400 when I think that if would give me: "-1400"
    Read the docs about readLine():
    The newline character ('\n') is included in the buffer.
    Therefore you have to QByteArray::chop() first.

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

    Default Re: other time...can't get date

    Many thanks!!!

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

    Default Re: other time...can't get date

    Many thanks!!!

Similar Threads

  1. time and date issues
    By boog07005 in forum Newbie
    Replies: 5
    Last Post: 20th August 2012, 15:15
  2. Date and Time Difference
    By MIH1406 in forum Newbie
    Replies: 4
    Last Post: 20th August 2012, 15:03
  3. Date and Time format.
    By kaushal_gaurav in forum Qt Programming
    Replies: 3
    Last Post: 12th August 2008, 11:36
  4. Date Time
    By starcontrol in forum Qt Programming
    Replies: 3
    Last Post: 4th April 2008, 11:02
  5. date-time problem
    By aegis in forum Qt Programming
    Replies: 5
    Last Post: 11th February 2007, 18:45

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.