Skip to main content

Module timestamp

Module timestamp 

Source
Expand description

Locale-dependent timestamp parsing for MTG Arena log entries.

MTGA log timestamps vary by system locale. This module handles all known formats (11+ locale-dependent variants, epoch milliseconds, .NET ticks, and ISO 8601).

§Timestamp semantics

Log entry header timestamps (e.g. 6/19/2026 10:37:13 AM) are local wall-clock time with no timezone information. parse_log_timestamp parses them into a NaiveDateTime and promotes the result with .and_utc(), but this label is misleading — the value is local time, not UTC. See EventMetadata::local_timestamp() for the honest zone-less accessor.

Embedded event-payload timestamps are the true UTC source:

  • Epoch-milliseconds ("timestamp": <i64>) — decoded by parse_epoch_millis and exposed via EventMetadata::instant_utc() for match-lifecycle events.
  • .NET ticks ("timestamp": "<i64>") — decoded by parse_dotnet_ticks; wiring to additional event types is deferred to a future release.

Enums§

TimestampError
Error returned when a timestamp cannot be parsed.

Functions§

parse_dotnet_ticks
Parses a .NET ticks value into a UTC datetime.
parse_epoch_millis
Parses a Unix epoch milliseconds value into a UTC datetime.
parse_iso8601
Parses an ISO 8601 datetime string into a UTC datetime.
parse_log_timestamp
Parses a locale-dependent timestamp from an MTGA log entry header.