Skip to content

Instantly share code, notes, and snippets.

@michaelkeevildown
Created January 12, 2017 12:03
Show Gist options
  • Save michaelkeevildown/c29b6d150559b1302a569d651c226238 to your computer and use it in GitHub Desktop.
Save michaelkeevildown/c29b6d150559b1302a569d651c226238 to your computer and use it in GitHub Desktop.
XBOX API - Timestamp Issue

Issues with timestamp parsing with python:

Most of your timestamps come out as such:

YYYY-mm-DDTHH:MM:SS.%fZ 2017-01-09T20:44:16.241201Z

However I have just see this: 2017-01-08T15:02:41.1218785Z

It seems to have an extra digit on the end? Am I missing something?

API Call: view-source:https://xboxapi.com/v2/2533274822972687/activity/recent

[
    {
        "startTime": "2017-01-09T20:44:16.241201Z",
        ...
    },
    {
        "startTime": "2017-01-08T20:41:46.038411Z",
        ...
    },
    {
        "startTime": "2017-01-08T15:02:41.1218785Z",
        "endTime": "2017-01-08T15:08:11.1218785Z",
        "sessionDurationInMinutes": 5,
        "contentImageUri": "http://images-eds.xboxlive.com/image?url=8Oaj9Ryq1G1_p3lLnXlsaZgGzAie6Mnu24_PawYuDYIoH77pJ.X5Z.MqQPibUVTcutO3qw8pipNxQ1JrSBL60JI3XuR7GtlfkdWm3OZwAEbSpVDqWEIymEjDLJGz8trmTpy3Fd.qYtVouzozVRJItzC3BOchGIckxJaSMirAWdhkBD1dZJRDZeccCpblJXwEYHqABKsV9LB9AG4P4vlZEiMue1v_WgCllhmHNHne6yU-",
        "bingId": "ad3bf8d9-d9e9-4652-a359-8957ce4f006f",
        "contentTitle": "STEEP",
        "vuiDisplayName": "STEEP",
        "platform": "XboxOne",
        "titleId": 265691378,
        "activity": {
            "startTime": "2017-01-08T15:02:41.1218785Z",
            "endTime": "2017-01-08T15:08:11.1218785Z",
            "numShares": 0,
            "numLikes": 0,
            "numComments": 0,
            "ugcCaption": null,
            "authorType": "None",
            "activityItemType": "Played",
            "userXuid": 2533274822972687,
            "date": "2017-01-08T15:02:41.1218785Z",
            "contentType": "Game",
            "titleId": 265691378,
            "platform": "XboxOne",
            "sandboxid": "RETAIL",
            "userKey": null,
            "scid": null
        },
        "description": "started playing STEEP",
        "date": "2017-01-08T15:02:41.1218785Z",
        "hasUgc": false,
        "activityItemType": "Played",
        "contentType": "Game",
        "shortDescription": "played a game",
        "itemText": "STEEP",
        "itemImage": "http://images-eds.xboxlive.com/image?url=8Oaj9Ryq1G1_p3lLnXlsaZgGzAie6Mnu24_PawYuDYIoH77pJ.X5Z.MqQPibUVTcutO3qw8pipNxQ1JrSBL60JI3XuR7GtlfkdWm3OZwAEb3bZ8gzbFpBg.dELhcro.TMafvZPrqBgfRvOUjSLK4JD3rJo1s4oyjgjr2lGK4cH8us1Be64v8agmwQNYKgAGxPBYgdWkkTxWBdKZJIhYqyCJLtbltKKkuhxojlXj4R3Y-",
        "shareRoot": "avty.xboxlive.com/users/xuid(2533274822972687)/contexts/9000001F1150F_2017_01_Played/activity/Activity.201701.08.2.0FD620F2.636194845611218785",
        "feedItemId": "avty.xboxlive.com/users/xuid(2533274822972687)/contexts/9000001F1150F_2017_01_Played/activity/Activity.201701.08.2.0FD620F2.636194845611218785",
        "itemRoot": "avty.xboxlive.com/users/xuid(2533274822972687)/contexts/9000001F1150F_2017_01_Played/activity/Activity.201701.08.2.0FD620F2.636194845611218785",
        "hasLiked": false,
        "authorInfo": {
            "name": "Flashmaaan",
            "secondName": "",
            "imageUrl": "http://images-eds.xboxlive.com/image?url=z951ykn43p4FqWbbFvR2Ec.8vbDhj8G2Xe7JngaTToBrrCmIEEXHC9UNrdJ6P7KI4AAOijCgOA3.jozKovAH90ptgjbRP3gD0sWX_rK3xxfasCmyJVyA.Hr1ke12UyBG&format=png",
            "authorType": "User",
            "id": 2533274822972687
        },
        "gamertag": "Flashmaaan",
        "realName": "",
        "displayName": "Flashmaaan",
        "userImageUri": "http://images-eds.xboxlive.com/image?url=z951ykn43p4FqWbbFvR2Ec.8vbDhj8G2Xe7JngaTToBrrCmIEEXHC9UNrdJ6P7KI4AAOijCgOA3.jozKovAH90ptgjbRP3gD0sWX_rK3xxfasCmyJVyA.Hr1ke12UyBG&format=png",
        "userXuid": 2533274822972687
    },
    {
        "startTime": "2017-01-05T12:28:07.9790032Z",
        ...
    },
    {
        "startTime": "2017-01-04T15:19:29.9005693Z",
        ...
    }
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment