date format

40 views
Skip to first unread message

matt quadros

unread,
Aug 22, 2023, 12:15:45 AM8/22/23
to MBTA Developers
Hello,

I just pulled some transit reliability data, and I'm seeing the service date listed as "1685505600000", rather than "20230521", and I'm having difficulty converting the format. Any advice on how to work with this format?

   "features": [
      {
         "attributes": {
            "service_date": 1685505600000,
            "gtfs_route_id": "Red",
            "gtfs_route_short_name": "NA",
            "gtfs_route_long_name": "Red Line",
            "gtfs_route_desc": "Rapid Transit",
            "route_category": "Red Line",
            "mode_type": "Rail",
            "peak_offpeak_ind": "PEAK",
            "metric_type": "Passenger Wait Time",
            "otp_numerator": 107340.143684546,
            "otp_denominator": 114782.841904052,
            "cancelled_numerator": 0,
            "ObjectId": 1
         }
      },

Jay Greenspan

unread,
Aug 22, 2023, 10:14:43 AM8/22/23
to massdotd...@googlegroups.com
That looks like a Unix epoch timestamp. For a conversion, see: https://www.epochconverter.com/
Any programming language will include functions to convert to a more readable date/time format. 

-j

--
You received this message because you are subscribed to the Google Groups "MBTA Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to massdotdevelop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/massdotdevelopers/ec8a5c8f-5c09-45b4-99c4-e08f65b0fd7fn%40googlegroups.com.

matt quadros

unread,
Aug 22, 2023, 8:24:16 PM8/22/23
to MBTA Developers
Thank you! This solved it - it's epoch timestamp in milliseconds!
Reply all
Reply to author
Forward
0 new messages