Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dalirnet/sysclock
Sets the system clock
https://github.com/dalirnet/sysclock
javascript nodejs
Last synced: 3 days ago
JSON representation
Sets the system clock
- Host: GitHub
- URL: https://github.com/dalirnet/sysclock
- Owner: dalirnet
- License: mit
- Created: 2021-06-17T11:14:13.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-06-17T15:38:27.000Z (over 3 years ago)
- Last Synced: 2024-10-07T13:48:17.379Z (about 1 month ago)
- Topics: javascript, nodejs
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# sysclock
Sets the system clock (ready for linux & win)
```javascript
import sysClock from "sysClock"// Create instance for current os platform
const sysClockInstance = sysClock()// Inactive network time protocl (NTP)
sysClockInstance
.ntp(false)
.then(() => {
// Inactive NTP
})
.catch((error) => {
// Error
})// Change date to Tue May 12 1992 09:30:00
sysClockInstance
.date("1992-05-12 09:30:00")
.then(() => {
// Changed date
})
.catch((error) => {
// Error
})// Active network time protocl (NTP)
sysClockInstance
.ntp(true)
.then(() => {
// Active NTP
})
.catch((error) => {
// Error
})
```