Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

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

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
})
```