Andrei Stalbe
Andrei Stalbe

Reputation: 1531

Google oAuth "expiry_date" format

I'm making a request to Google oAuth in order to exchange the authorization code with an access_token, however, the response returned contains the expiry_date (instead of expires_in as in the documentation here) with a value of 1474636927720. This is not a timestamp format as I can see, any ideas what is it? PostgreSQL throws this date/time field value out of range. I have no problem storing this as a string but would like to know the value so that I can check if the token is expired or not.

Upvotes: 4

Views: 3797

Answers (1)

skymon
skymon

Reputation: 870

I know it is kind of old, but I was just asking myself the same question. Right now I'm almost certain, that it's just Unix timestamp with milliseconds. In Java there is the method System.currentTimeMillis() for that and a currentmillis website converts your value of 1474636927720 to Fri Sep 23 2016 13:22:07 UTC, which seems to be in line with the datetime of your post.

Upvotes: 5

Related Questions