Skip to content

Timestamp appears to be localised #13

Open

Description

@SavageCore

I have been testing a few more replays and found that they display different timestamp values, possibly based on the locale.

101: 13.04.2023 20:08
90: 2023/4/9上午 12:45
91: 08/04/2023 19:28

Would it be better to return these as Unix time?

Activity

  1. ryantaylor commented on Apr 18, 2023

    @ryantaylor
    Owner

    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.

  2. SavageCore commented on Apr 18, 2023

    @SavageCore
    Author

    I feared that would be the case. I wonder if the locale is hiding in there?

  3. ryantaylor commented on Apr 20, 2023

    @ryantaylor
    Owner

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions