Results 1 to 3 of 3

Thread: convert decimal seconds to QDateTime and back

  1. #1
    Join Date
    Nov 2009
    Location
    San Antonio, TX
    Posts
    69
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt Jambi
    Platforms
    Unix/X11 Windows

    Default convert decimal seconds to QDateTime and back

    I have an application that is using decimal time in seconds. I want to use the QDateTimeEdit to display the value in a more readable format to allow a user to change the value. I then would like to retrieve the time back into a decimal time in seconds. I cannot see any convenient functions to convert back and forth.

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

    Default Re: convert decimal seconds to QDateTime and back


  3. #3
    Join Date
    Nov 2009
    Location
    San Antonio, TX
    Posts
    69
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt Jambi
    Platforms
    Unix/X11 Windows

    Default Re: convert decimal seconds to QDateTime and back

    I need more precision than just seconds resolution . . . and I would prefer more than millisecond resolution, but I think I am asking for too much there. The decimal seconds I am using is a "double" value with the fractional part being the fractional seconds.

Similar Threads

  1. How to get seconds diferences between two datetime
    By gustavedgardo in forum Newbie
    Replies: 1
    Last Post: 4th March 2009, 22:05
  2. Replies: 6
    Last Post: 4th February 2009, 07:46
  3. Convertng FILETIME timestamp to QDateTime and back again
    By grabnerj in forum Qt Programming
    Replies: 3
    Last Post: 7th July 2008, 22:27
  4. How to wait 2 seconds before continue
    By raphaelf in forum Newbie
    Replies: 3
    Last Post: 25th June 2008, 14:36
  5. How to convert unix time to QDateTime
    By lni in forum Qt Programming
    Replies: 3
    Last Post: 14th November 2007, 00:25

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.