Back to Redis

TIME

content/commands/time.md

latest1.2 KB
Original Source

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

{{% redis-cli %}} TIME TIME {{% /redis-cli %}}

Redis Software and Redis Cloud compatibility

| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | |

Return information

{{< multitabs id="time-return-info" tab1="RESP2" tab2="RESP3" >}}

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

-tab-sep-

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

{{< /multitabs >}}