libfaketime is a library that intercepts system time calls to report modified dates and times to individual applications without changing the system clock.
The tool solves the problem of testing time-dependent behavior in isolation by using the linker's library preload mechanism to intercept system calls that retrieve the current date and time. It allows you to specify both absolute dates and relative offsets, so a program can be made to see any point in time you choose.
Developers should choose this tool when they need to test time-sensitive code in a controlled way or ensure reproducible builds. It works well for applications that rely on standard system time calls, but has limitations: it cannot intercept statically linked binaries or setuid programs, and some language runtimes that use vDSO or direct system calls may bypass the interposition entirely. The tool ships with a command-line wrapper called faketime for common use cases, though direct library use may be necessary for advanced scenarios.
The project maintains comprehensive continuous integration coverage across multiple platforms including macOS and various Linux distributions, with tests deliberately distinguishing between core functionality and optional runtime-specific checks. The documented C code examples are compiled and run in CI, including optional deterministic-random interfaces. Test infrastructure includes bounded Docker-based runs for local verification and time-bounded sanitizer jobs that upload complete logs on failure.