Socket
Book a DemoInstallSign in
Socket

global-time

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

global-time

Gets UTC real time from http://worldtimeapi.org/api/timezone/Etc/UTC.

latest
Source
npmnpm
Version
1.5.1
Version published
Weekly downloads
49
16.67%
Maintainers
1
Weekly downloads
 
Created
Source

All dependencies Reported vulnerabilities Commits NPM-version Total downloads Developed by
Publish size Install size Minified size Minified + gzipped size

global-time@1.5.1

Gets UTC real time in milliseconds with 0.001 precision from http://worldtimeapi.org/api/timezone/Etc/UTC.
From v1.3.0 no longer supports https://time.gov/actualtime.cgi due missing time value.

It's completely not dependent on machine local time.

Installation

global-time is available via NPM:

$ npm i global-time@1.5.1

Usage

import globalTime from 'global-time';

(async () => {
  const time = await globalTime();
  const date = new Date(time);

  console.log(time);  // 1616323147279.481
  console.log(date);  // 2021-03-21T10:39:07.279Z
})();

Testing

$ npm test

Your improve suggestions and bug reports are welcome any time.

Keywords

global-time

FAQs

Package last updated on 27 Oct 2021

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