# setSystemTime

Change the system time to the new now. Now can be a timestamp, date object, or not passed in which defaults to 0. No timers will be called, nor will the time left before they trigger change.

## Usage[​](#usage "Direct link to Usage")

```
const clock = await browser.emulate('clock', { ... })
await clock.setSystemTime(date)
```

## Parameters[​](#parameters "Direct link to Parameters")

| Name   | Type           | Details                                 |
| ------ | -------------- | --------------------------------------- |
| `date` | `Date, number` | The new date to set the system time to. |

## Example[​](#example "Direct link to Example")

setSystemTime.js

```
const clock = await browser.emulate('clock', { now: new Date(2021, 3, 14) })
console.log(await browser.execute(() => new Date().getTime())) // returns 1618383600000

await clock.setSystemTime(new Date(2011, 3, 15))
console.log(await browser.execute(() => new Date().getTime())) // returns 1302850800000
```

## Returns[​](#returns "Direct link to Returns")

* **< `Promise<void>` >**
