What's new in Valkey 9.0? Discover new features and improvements. Read the announcement.

TIME

Returns the server time.

Usage
TIME
Complexity
O(1)
Since
2.6.0
ACL Categories
@fast
Command flags
LOADING, STALE, FAST

The TIME command returns the current server time as a two items lists: a Unix timestamp and the amount of microseconds already elapsed in the current second. Basically the interface is very similar to the one of the gettimeofday system call.

Examples

127.0.0.1:6379> TIME
1) "1714701491"
2) "723379"
127.0.0.1:6379> TIME
1) "1714701491"
2) "731773"

Replies

RESP2

Array reply: specifically, a two-element array consisting of the Unix timestamp in seconds and the microseconds' count.

RESP3

Array reply: specifically, a two-element array consisting of the Unix timestamp in seconds and the microseconds' count.