Socket
Socket
Sign inDemoInstall

exact-time

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

exact-time

Get the exact date and time with ease


Version published
Maintainers
1
Created
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

Package last updated on 25 Dec 2017

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc