Mushin.3928:

I have been taking screenshots of the end game leaderboard after a PvP match ends. I have the game set to display the time in-game so I can see it on each screenshot.

In the API response for a game, It appears that the “started” time actually is the end time. The time value in this field matches my screenshot. The “ended” time is always later than the start time but I don’t know what it represents, since it is often much later than the actual end time (in one case I see that it is 12 minutes later).

I know that the time on my PC is correct, because it is synced to the network and it matches other things like my phone. I know I’m looking at the right game from the API too because the map and final score matches what is in my screenshot.

The reason I’m looking at this is that I wrote a program to querymy games from the API and then organize screenshots/videos associated with each game. Since the time values are off, my program isn’t matching up the media files correctly.

Lawton Campbell.8517:

Could you provide some more data? Like, expected start/end, actual start/end for a match or two?

EDIT: nm, Evan poked around in the code for me and you’re totally right; the date the API is reading is the end date, and it’s adding the duration to that. Tracking issue.

Mushin.3928:

If this is fixed, do you know if it would take effect for old games? I could implement a workaround right now that queries an old game and checks to see if it’s “ended” time is what I expect it should be. If it isn’t, I can do my own date calculations based on end time and duration. But this presupposes that its just a code bug or that the data the API uses will be refreshed with the correct values for all time.

Thanks for the hard work on the API. I dig it.

Lawton Campbell.8517:

If this is fixed, do you know if it would take effect for old games?

Yeah, it’ll take effect for old games. The stored data is correct — there’s a date/duration for each game — the API frontend is just misinterpreting the date as the start date rather than the end date.

Should have it fixed by the end of the week.