---
title: "PEXPIRE"
url: "https://docs.yugabyte.com/stable/yedis/api/pexpire/"
---

# PEXPIRE

## Synopsis

**`PEXPIRE key timeout`**

This command works exactly like EXPIRE but the time to live of the key is specified in milliseconds instead of seconds.

## Return value

Returns integer reply, specifically 1 if the timeout was set and 0 if key does not exist.

## Examples

```sh
$ SET yugakey "Yugabyte"
```

```
"OK"
```

```sh
$ PEXPIRE yugakey 10000
```

```
(integer) 1
```

```sh
$ PTTL yugakey
```

```
(integer) 9995
```

## See also

[`expire`](/stable/yedis/api/expire/ "expire"), [`ttl`](/stable/yedis/api/ttl/ "ttl"), [`pttl`](/stable/yedis/api/pttl/ "pttl"), [`set`](/stable/yedis/api/set/ "set")
