libfaketime

Intercept and modify system time for testing time-dependent code

brewmacoslinux
Try with needOr install directly
Source

About

Report faked system time to programs

Commands

faketime

Examples

Run a program with a specific fake date$ faketime '2020-01-15 10:30:00' ./my_program
Test with relative time offset (1 month in the past)$ faketime '-1m' date
Run a script with accelerated time progression (2x speed)$ faketime -f '+2d x2' /path/to/script.sh