You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately Relic stores timestamps as UTF-16 strings in the replay files. I'm honestly not entirely sure why. There might be a UNIX timestamp in the replay file somewhere, but if there is I haven't found it. Given the complexities around converting so many localized timestamps into UNIX time, I'd rather leave that to the user unless we can find a UNIX timestamp in the replay file somewhere.
Unfortunately I think they just record the system time as it is returned from the OS in UTF-16 string format. My local machine runs 24-hour time and replays recorded from my machine have 24-hour timestamps, whereas other English-language replays I've seen/parsed seem to reflect their local machine times (and the examples you show speak to a similar conclusion).
The Relic API, however, does seem to record the UNIX timestamp at which a game began and ended. Since replays contain match IDs that we can map to games in the API, it's possible that the replay also stores the UNIX timestamp(s). If so, we could match a replay to its API result and then search the file for an integer matching the UNIX timestamp returned from the API. I'll give that a try later and see if I can find a match.
Activity
ryantaylor commentedon Apr 18, 2023
Unfortunately Relic stores timestamps as UTF-16 strings in the replay files. I'm honestly not entirely sure why. There might be a UNIX timestamp in the replay file somewhere, but if there is I haven't found it. Given the complexities around converting so many localized timestamps into UNIX time, I'd rather leave that to the user unless we can find a UNIX timestamp in the replay file somewhere.
SavageCore commentedon Apr 18, 2023
I feared that would be the case. I wonder if the locale is hiding in there?
ryantaylor commentedon Apr 20, 2023
Unfortunately I think they just record the system time as it is returned from the OS in UTF-16 string format. My local machine runs 24-hour time and replays recorded from my machine have 24-hour timestamps, whereas other English-language replays I've seen/parsed seem to reflect their local machine times (and the examples you show speak to a similar conclusion).
The Relic API, however, does seem to record the UNIX timestamp at which a game began and ended. Since replays contain match IDs that we can map to games in the API, it's possible that the replay also stores the UNIX timestamp(s). If so, we could match a replay to its API result and then search the file for an integer matching the UNIX timestamp returned from the API. I'll give that a try later and see if I can find a match.