OS Manuals

/usr/bin/faketime

libfaketime modifies the system time for a single application

From libfaketime 0.9.13-r2 (os), captured 2026-11-05 by running faketime --help (exit 0). permalink

Usage: /usr/bin/faketime [switches] <timestamp> <program with arguments>

This will run the specified 'program' with the given 'arguments'.
The program will be tricked into seeing the given 'timestamp' as its starting date and time.
The clock will continue to run from this timestamp. Please see the manpage (man faketime)
for advanced options, such as stopping the wall clock and make it run faster or slower.

The optional switches are:
  -m                  : Use the multi-threaded version of libfaketime
  -f                  : Use the advanced timestamp specification format (see manpage)
  --exclude-monotonic : Prevent monotonic clock from drifting (not the raw monotonic one)
  --disable-shm       : Disable use of shared memory by libfaketime.
  --date-prog PROG    : Use specified GNU-compatible implementation of 'date' program

Examples:
/usr/bin/faketime 'last friday 5 pm' date
/usr/bin/faketime '2008-12-24 08:15:42' date
/usr/bin/faketime -f '+2,5y x10,0' bash -c 'date; while true; do echo $SECONDS ; sleep 1 ; done'
/usr/bin/faketime -f '+2,5y x0,50' bash -c 'date; while true; do echo $SECONDS ; sleep 1 ; done'
/usr/bin/faketime -f '+2,5y i2,0' bash -c 'date; while true; do date; sleep 1 ; done'
In this single case all spawned processes will use the same global clock
without restarting it at the start of each process.

(Please note that it depends on your locale settings whether . or , has to be used for fractions)
Options (8)
OptionDescriptionSource
-m: Use the multi-threaded version of libfaketimehelp + man
-f: Use the advanced timestamp specification format (see manpage)help + man
--disable-shm: Disable use of shared memory by libfaketime.help + man
--date-prog PROGUse a specific GNU-date compatible implementation of the helper used to transform "timestamp format" strings into programmatically usable dates, instead of a compile-time default guess for the…help + man
--helpshow usage information and quit. (in the manual page but not in --help)man
--versionshow version information and quit. (in the manual page but not in --help)man
-p PIDpretend that the program's process ID is PID. (in the manual page but not in --help)man
--exclude-monotonicDo not fake time when the program makes a call to clock_gettime with a CLOCK_MONOTONIC clock. (in the manual page but not in --help)man
Examples (1) from the manual page, untested

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.