Socket
Socket
Sign inDemoInstall

exact-time

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    exact-time

Get the exact date and time with ease


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Install size
5.19 kB
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 25 Dec 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc