@inrixia/set-system-clock
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

Set-System-Clock

Sets the system date and time through the use of platform dependent commands.

Only supports Windows and Linux as of now.

This is a fork of @ConnorChristie/Set-System-Clock with updates & fixes such as async and timezone support from #4

Installation

npm i @inrixia/set-system-clock -s

API

DateTimeControl.setDateTime

// @dateTime - The date and time to set the system clock to
DateTimeControl.setDateTime(dateTime: Date);

Code Example

import DateTimeControl from "@inrixia/set-system-clock";
// or const DateTimeControl = require("set-system-clock");

// Sets the date and time to the date specified, returns a promise resolves once date/time is set
DateTimeControl.setDateTime(new Date("8/1/2017 13:14:12"));

Options:

// Use Sudo (Linux only)
DateTimeControl.setDateTime(new Date("8/1/2017 13:14:12"), { useSudo: true });

Readme

Keywords

Package Sidebar

Install

npm i @inrixia/set-system-clock

Weekly Downloads

0

Version

1.1.1

License

ISC

Unpacked Size

5 kB

Total Files

10

Last publish

Collaborators

  • inrixia