0

I like to know how to specify unix-timestamp in redis.

for command like SET name xyz EXAT 1617875638 //is wrong format cli says On my terminal timestamp is something like this 1617875638. this is exception causing. wrong format.

user786
  • 3,902
  • 4
  • 40
  • 72

1 Answers1

1

EXAT option is added in Redis 6.2. If your Redis is older than 6.2, it cannot support it. Instead, you can use Lua script to implement it:

eval 'redis.call("set", KEYS[1], ARGV[1]); redis.call("expireat", KEYS[1], ARGV[2])' 1 name xyz 1617875638
for_stack
  • 21,012
  • 4
  • 35
  • 48