setSystemTime

Bun

Symbol

setSystemTime

function setSystemTime(now?: number | Date): ThisType<void>

Control the system time used by:

  • Date.now()
  • new Date()
  • Intl.DateTimeFormat().format()

In the future, we may add support for more functions, but we haven't done that yet.

@param now

The time to set the system time to. If not provided, the system time will be reset.

@returns

this