Skip to content

wll8/get-safe-date

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

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

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

About

Used for scenarios that require verification time.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published