Skip to main content

PEXPIRETIME

Syntax​

PEXPIRETIME key

Module​

generic

Categories​

fast keyspace read

Description​

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​

Retrieve the expiration time of a key:

db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
pexpireTime, err := db.PExpireTime("key")