NodeRedis/node-redis

View on GitHub
examples/get-server-time.js

Summary

Maintainability
A
0 mins
Test Coverage
// Get the time from the Redis Server.

import { createClient } from 'redis';

const client = createClient();
await client.connect();

const serverTime = await client.time();
// 2022-02-25T12:57:40.000Z { microseconds: 351346 }
console.log(serverTime);

client.destroy();