Search code examples
google-play-integrity-api

does timestampMillis resulting from Play Integrity API check is timezone aware?


I'm implementing the "Play Integrity" API check.

In the integrity response there is timestampMillis that indicates when the request occurs.

Is it timezone aware?


Solution

  • The timestampMillis field in the response of the integrity API check is in Unix time format, which is the number of milliseconds since January 1, 1970, 00:00:00 UTC

    so ,it is not tied to any specific time zone but it represents fixed point in time that is the same regardless of the time zone when you parse timestamp on your end you can change to local time zone or any other time zone

    example in js

    const unixTimestamp = 1681481133977;
    const date = new Date(unixTimestamp);
    console.log(date.toLocaleString());
    

    Unix time format