This document introduces libTimeMachine, a library that allows manipulating the system time reported to PHP for testing purposes. It works by overriding PHP's system calls for getting the time (time(), gettimeofday(), etc.) and changing them to report a simulated past or future time. This allows unit testing code that relies on or processes time-based logic and events. The library works on Linux and Mac OS X and can be used with the PHP command line, built-in web server, and Apache+mod_php.