Results 1 to 4 of 4

Thread: Convertng FILETIME timestamp to QDateTime and back again

  1. #1
    Join Date
    Jun 2008
    Posts
    4
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Convertng FILETIME timestamp to QDateTime and back again

    I need to convert a FILETIME timestamp to QDateTime and back again. The data I receive and send uses a FILETIME structure to pass the UTC date and time around. I need to do this without lose.

    John.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Convertng FILETIME timestamp to QDateTime and back again

    Quote Originally Posted by grabnerj View Post
    I need to do this without lose.
    QTime has 1 ms accuracy (on some systems it might be worse), while FILETIME has 100 ns. You can't do that without a lose.

  3. #3
    Join Date
    Jun 2008
    Posts
    4
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Convertng FILETIME timestamp to QDateTime and back again

    is it possible to so it at 1ms accuracy?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Convertng FILETIME timestamp to QDateTime and back again

    You can use FileTimeToSystemTime() and pass appropriate fields to QTime constructor.

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.