# Expire at Timestamp

> How do you make a Redis key expire at a specific point in time (for example, midnight tonight) rather than after a relative number of seconds?

Canonical: https://www.internhack.in/learn/interview/redis-caching/redis-expire-at-timestamp
Last updated: 2026-11-28

Difficulty: Beginner

## Question

How do you make a Redis key expire at a specific point in time (for example, midnight tonight) rather than after a relative number of seconds?

*The full answer is for InternHack members. Open the page link above to read it.*

## Concepts covered

EXPIREAT, PEXPIREAT, UNIX timestamp, EXPIRETIME, SET EXAT

Previous: [Hash vs. Individual Keys](https://www.internhack.in/learn/interview/redis-caching/redis-hash-vs-individual-keys) · Next: [Client ID](https://www.internhack.in/learn/interview/redis-caching/redis-client-id-command) · [All of Redis & Caching](https://www.internhack.in/learn/interview/redis-caching)

## More Redis & Caching questions

- [Wiping Data](https://www.internhack.in/learn/interview/redis-caching/redis-flush-commands)
- [Multiple Databases](https://www.internhack.in/learn/interview/redis-caching/redis-databases-count)
- [Atomic SET if not exists](https://www.internhack.in/learn/interview/redis-caching/redis-atomic-set-nx)
- [ZSET Range Query](https://www.internhack.in/learn/interview/redis-caching/redis-zset-range-by-score)
- [Script Caching](https://www.internhack.in/learn/interview/redis-caching/redis-lua-script-cache)
- [Pausing Clients](https://www.internhack.in/learn/interview/redis-caching/redis-client-pause)

## Related

- [Learn](https://www.internhack.in/learn)
- [Interview Prep](https://www.internhack.in/learn/interview)
- [Redis & Caching](https://www.internhack.in/learn/interview/redis-caching)
