Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 760
Andrei Stalbe Avatar asked Sep 16 '25 18:09

Andrei Stalbe


1 Answers

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.

like image 109
skymon Avatar answered Sep 18 '25 10:09

skymon