Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/wll8/get-safe-date

Used for scenarios that require verification time.
https://github.com/wll8/get-safe-date

Last synced: about 4 hours ago
JSON representation

Used for scenarios that require verification time.

Awesome Lists containing this project

README

        

Used for scenarios that require verification time.

They are parsed from local files instead of directly obtaining maliciously modified system time or network time.

how to work:
- Get the latest network time
- Analyze the latest time of multiple files
- Store last latest time
- Compare and return the latest time

E.g:

Your system time just now was 2022-09-30, now you turn off the network and set it to 2011-01-31, you can still get 2022-09-30 through this program.

``` js
const { getSafeDate } = require(`get-safe-date`)

new Promise(async () => {
const date = await getSafeDate()
console.log(`date`, date) // timestamp
})
```