Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/wll8/get-safe-date
- Owner: wll8
- License: mit
- Created: 2022-09-30T09:16:20.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-30T09:16:31.000Z (about 2 years ago)
- Last Synced: 2024-11-08T09:50:18.379Z (11 days ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
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 timeE.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
})
```