PEXPIRETIME
Syntax
PEXPIRETIME key
Module
genericCategories
fast keyspace readDescription
Returns the absolute unix time in milliseconds when the key will expire. Returns -1 if the key exists but has no associated expiry time. Returns -2 if the key does not exist.
Examples
- Go (Embedded)
- CLI
Retrieve the expiration time of a key:
db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
pexpireTime, err := db.PExpireTime("key")
Retrieve the expiration time of a key:
> PEXPIRETIME key