When retrieving place details in the Google Places API, the array for reviews includes objects representing each review. In these objects, there is a key called "time". I assume this is a value representing some date/time when the review was written, but I don't know how to interpret this value, and I can't find any documentation on that value.
Here is an example review object:
"author_name": "Erin Hardie",
"author_url": "https://plus.google.com/112006772111566435910",
"language": "en",
"rating": 5,
"text": "Our daughter has loved her time at...(truncated for display)",
"time": 1374519902
I use moment.js to handle all my time/date displays, but I dont even know what this number represents. Help!
With some in depth googling, I finally found an answer to this. The "time" is a unix timestamp. You can deal with it in php with something like this:
Or, you can deal with it using moment.js in javascript by multiplying the timestamp by 1000, as javascript expects milliseconds. Here's where I found my answer in their code:
http://gurutechnolabs.tumblr.com/post/112214772991/how-to-embed-google-reviews-using-google-places
And heres how I found how to convert Unix timestamps to something javascript understands:
using a php unix timestamp with moment.js