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.
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.
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