Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] Unixtime with QJson, too long?

[SOLVED] Unixtime with QJson, too long?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 991 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gandiii
    wrote on last edited by
    #1

    Hi,

    I'm using QJson (Qt > 5) as protocol between server and client.
    If I want to send the actual time in unixtime format, the
    last 4-5 digits are zero.

    I think the problem is, that QJsonObject has only a double value and no
    integer.
    So I tried to reintpret int to double and on the server the other way, but this doesn't worked.

    Is there a other solution?
    thx

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      A double should have sufficient significant digits to handle the time_t UNIX epoch figure without losing precision. Perhaps you are mishandling it.

      Alternative: Send it as a string

      1 Reply Last reply
      0
      • G Offline
        G Offline
        gandiii
        wrote on last edited by
        #3

        bq.
        Alternative: Send it as a string

        many thanks, I was really blind

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved