Wraps libfaketime (github.com/wolfcw/libfaketime), the LD_PRELOAD library that fakes the clock for any binary by intercepting time() / gettimeofday() / clock_gettime(). Covers absolute-date mode (FAKETIME='2026-12-31 23:59:00'), relative offset (FAKETIME='-1d'), advance-rate (FAKETIME='@2026-12-31 23:59:00 x5' for 5x speed), per-process scope via LD_PRELOAD, and FAKETIME_NO_CACHE for high-resolution mocking. Use when you need to fake time, mock the clock, or freeze time for C/C++ or any native binary that needs deterministic wall-clock time.
76
96%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Medium
Suggest reviewing before use
Deeper variants beyond the core absolute-date mode. All flags and syntax per github.com/wolfcw/libfaketime.
Move the clock a fixed delta from real time instead of pinning an absolute instant:
faketime '-1d' your_command # 1 day in the past
faketime '+1y' your_command # 1 year in the future
faketime '+2h30m' your_command # 2h30m aheadThe -f flag plus an @start xRATE spec starts at a fixed instant and
advances faster (or slower) than real time:
faketime -f '@2026-12-31 23:59:00 x10' your_command
# Starts at 23:59:00 on 2026-12-31, advances 10x real-timeUseful for testing schedulers, cron simulations, and long-running clock progress.
FAKETIME_NO_CACHE=1 faketime '2026-12-31 23:59:00' your_commandDisables the per-second caching libfaketime does for performance. Tests that read time hundreds of times per second then see consistent behaviour.
faketime '2026-03-08 02:30:00 EDT' ./my-program
# Tests behaviour at a non-existent local time (spring-forward) per
# dst-transition-reference# Simulate a year in ~10 minutes (1 sec real = 1.46 hrs simulated)
faketime -f '@2026-01-01 00:00:00 x5256' ./cron-runnerTZ='America/New_York' faketime '2026-03-08 02:30:00' ./my-program