Skip to main content

Description

Returns the current server time as a tuple of Unix timestamp and microseconds.

Method Signature

Parameters

This command takes no parameters.

Return Value

result
[number, number]
A tuple containing:
  1. Unix timestamp - Current server time in seconds since Unix epoch
  2. Microseconds - Microseconds component of the current time

Examples

Get server time

Convert to JavaScript Date

Calculate timestamp with microsecond precision

Measure server time difference

Compare server time with client time

Use for unique IDs

Use Cases

  • Clock synchronization - Compare server and client times
  • Distributed timestamps - Get consistent time across multiple clients
  • Benchmarking - Measure operation duration with microsecond precision
  • Unique ID generation - Create time-based unique identifiers

See Also

  • ping - Test server connection