Search code examples
javascriptjqueryjsonmeetup

How do I convert the "time" from the Meetup API to a recognizable format?


http://www.meetup.com/meetup_api/docs/2/event/

Here's the Meetup API's definition of time:

Event start time in milliseconds since the epoch, or relative to the current time in the d/w/m format.

Here's the type of value I see returned in the JSON:

"time": 1382742000000,

Any advice about how to convert it into something recognizable?


Solution

  • You can construct a date object like this

    var date = new Date(milliseconds);
    

    And then you could apply any format you want using Date properties