[SOLVED] Unixtime with QJson, too long?



  • 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



  • 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



  • bq.
    Alternative: Send it as a string

    many thanks, I was really blind


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.