Python SDK — Server Data

Server time is the authoritative clock every player agrees on — use it for shared countdowns, expiry checks and skew measurement instead of trusting device clocks.

Time Management — client.time

get_server_time
client.time.get_server_time() -> ServerTimeResponse

Retrieves current server time: utc (datetime), timestamp and readable.

get_server_time_with_offset
client.time.get_server_time_with_offset(utc_offset: int) -> ServerTimeWithOffsetResponse

Retrieves server time adjusted by a UTC offset in hours (e.g. 3 for UTC+3, -5 for UTC-5).

Authoritative server time

Get returns the authoritative server clock — the one timestamp every player agrees on. Use it for shared countdowns, round-end deadlines, cooldown and expiry checks: anything a client clock can cheat or drift on. A UTC option keeps the value timezone-correct wherever the player is.

The offset variant exists for skew math: measure the difference once at session start, then offset local timestamps and you only pay the round trip once. The same call doubles as a lightweight latency probe — the CLI's bench command times it for exactly that reason.

  • Sync shared timers (round ends, vote deadlines) against server time so every client hits zero together.
  • Never trust the device clock for game rules — players can set it forward to skip cooldowns.
  • Measure skew once and reuse the offset — calling per check adds latency without extra accuracy.
  • Calls are synchronous functions — wrap them in asyncio.to_thread or your engine's job system when the game loop cannot block, and reuse one client across coroutines.