Dateshift - a date/time test tool

Dateshift is a tool for shifting date/time. In particular it allows a process or set of process to run with a different clock setting, without having to change the system clock.

This is useful because changing the system clock requires root privilege and is inconvienient on shared machines.


Why would you want to test software at different dates/times? Some example uses:

  • Use dateshift to test your finance package on 29th Feb

  • Use dateshift to find out what happens when unix time wraps around in 2037.

  • Use dateshift to test your new clock program!

Getting Dateshift

You can download the source code from the links below. I've tested it 1.1 on Linux and 1.0 on Linux and Solaris.


Installing Dateshift

For installation dateshift using the usual sequence of commands:

tar xzvf dateshift-1.1.tar.gz

cd dateshift



make install

User Documentation

Dateshift comes with a manual page. You can see an html version of it here.

How does it work?

Dateshift intercepts the time() and gettimeofday() using the run time linker's LD_PRELOAD feature.


Dateshift is Copyright 2002,2009 Alex Hornby under the terms of the GNU General Public Licence version 2 or later.

Contact the author:Alex Hornby

Alex's Home Page