exact-time
v0.0.3
Published
Get the exact date and time with ease
Downloads
4
Maintainers
Readme
exact-time
Promise based lib to get the exact date and time with ease.
Installation
$ npm install --save exact-time
Usage
const exactTime = require('exact-time')
exactTime.getDate()
.then(date => console.log(date.toString()))
// Thu May 11 2017 12:20:40 GMT+0200 (CEST)
Example
$ node examples/time.js
Exact time: Thu May 11 2017 12:20:40 GMT+0200 (CEST)
Your system clock is 1 minute and 7 seconds behind.
API
getDate([forceNetSync])
Type: Date
Returns a Date object with the exact time.
getOffset([forceNetSync])
Type: Number
Returns the difference between system time and exact time in seconds.
forceNetSync
Type: Boolean
Forces a new time sync with the server.
License
MIT © Vincenzo Greco