Back to Redis

EXPIRETIME

content/commands/expiretime.md

latest1.6 KB
Original Source

Returns the absolute Unix timestamp (since January 1, 1970) in seconds at which the given key will expire.

See also the [PEXPIRETIME]({{< relref "/commands/pexpiretime" >}}) command which returns the same information with milliseconds resolution.

Examples

{{% redis-cli %}} SET mykey "Hello" EXPIREAT mykey 33177117420 EXPIRETIME mykey {{% /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="expiretime-return-info" tab1="RESP2" tab2="RESP3" >}}

One of the following:

-tab-sep-

One of the following:

{{< /multitabs >}}