The time
command gives me a list, and I'm not able to get the first element in it using any normal list commands.
redis 127.0.0.1:6379> time
1) "1375802172"
2) "168215"
redis 127.0.0.1:6379> lrange time 0 1
(empty list or set)
It is completely unrelated to a Redis list type. The fact that a number of list operations return a multi-bulk reply does not mean that all multi-bulk replies are Redis lists.
TIME does return a standard multi-bulk reply containing two values. The first one is the Unix epoch time, and the second the number of microseconds.
If you only need one of these values, it is up to the client program to select it.
The previous answer is correct, TIME does not return a redis list.
However, you might be able to achieve what you are seeking using a lua script:
EVAL "return redis.call('TIME')[1]" 0 0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With