content/commands/expiretime.md
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.
{{% redis-cli %}} SET mykey "Hello" EXPIREAT mykey 33177117420 EXPIRETIME mykey {{% /redis-cli %}}
| 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> | |
{{< multitabs id="expiretime-return-info" tab1="RESP2" tab2="RESP3" >}}
One of the following:
-1 if the key exists but has no associated expiration time.-2 if the key does not exist.-tab-sep-
One of the following:
-1 if the key exists but has no associated expiration time.-2 if the key does not exist.{{< /multitabs >}}