bnPYSse
bnPYSse

Reputation: 417

How can I get the system time of redis server by using Jedis?

Ok.I found the Redis's System service command is TIME,and I can use this command to get the system time of Redis server.

But I can't find the same command in the Jedis.

In the java, How do I get the system time of the Redis server?

And the TIME command return the Multi-bulk reply,How do I get the value of TIME,and using it in my Java client?

If you have the example,Thanks very much!

Upvotes: 0

Views: 1167

Answers (1)

bnPYSse
bnPYSse

Reputation: 417

Ok,I have a solution is:

Object o = jedis.eval("return redis.call('time')[1]"); Log(TAG,"o-->"+o.toString());

it can get the system time of the Redis server!

Upvotes: 2

Related Questions