1 | Gets UTC real time in milliseconds with 0.001 precision from http://worldtimeapi.org/api/timezone/Etc/UTC.
|
2 | No longer supports https://time.gov/actualtime.cgi due missing time value.
|
3 |
|
4 | **It's completely not dependent on your system or local time.**
|
5 |
|
6 | ## Installation
|
7 | `global-time` is available via npm:
|
8 | ``` bash
|
9 | $ npm i global-time
|
10 | ```
|
11 |
|
12 | ## Usage
|
13 | ``` js
|
14 | const globalTime = require('global-time');
|
15 |
|
16 | (async () => {
|
17 | const time = await globalTime();
|
18 | const date = new Date(time);
|
19 |
|
20 | console.log(time); // 1560529986678.603
|
21 | console.log(date); // 2019-06-14T16:33:06.678Z
|
22 | })();
|
23 | ```
|
24 |
|
25 | ## Testing
|
26 | ``` bash
|
27 | $ npm test
|
28 | ```
|