1dateshift(1)                      Test tools                      dateshift(1)
2
3
4

NAME

6       dateshift - Moves system date for program under test
7

SYNTAX

9       dateshift -t "<YYYY-MM-DD> [HH:MM:SS]" [ - <program> ]
10

DESCRIPTION

12       Moves  system  date  for program under test. Once the date is moved the
13       clock continues ticking, so that the program under test  is  now  in  a
14       time warp.
15
16       dateshift is generally more convienient than changing the system clock,
17       and does not require root privileges.
18
19       If you do not specify a command then your shell will be run.
20
21       The dates and times are in ISO-8601 format. This means that  dates  are
22       YEAR-MONTH-DAY  and  times are HOUR:MINUTE:SECOND. Hours are in 24-hour
23       format.
24

OPTIONS

26       -h     Output help information and exit.
27
28       -t <YYYY-MM-DD> [HH:MM:SS]
29              Specify the command to run in the date shifted environment
30
31       -v     Output version information and exit.
32
33       -d     Run in verbose output mode
34

ENVIRONMENT VARIABLES

36       DS_OFFSET
37              dateshift sets this to the number of seconds offset
38
39       LD_PRELOAD
40              dateshift uses LD_PRELOAD to intercept calls to time() and  get‐
41              timeofday()
42
43

EXAMPLES

45       You can run a program at a different time like so:
46
47       dateshift -t 2001-01-01 - date
48
49       To run a time shifted shell to 20th Jan 2000 do:
50
51       dateshift -t 2001-01-20
52
53       Alternatively you can run it with a time as well
54
55       dateshift -t "2001-01-20 18:00:00"
56

LIMITATIONS

58       dateshift works via the run time linker's LD_PRELOAD mechanism. It will
59       therefore not work on statically linked executables.
60
61       Also dateshift does not wrap stat()  or  other  file  based  functions.
62       Therefore  programs  which  get file timestamps will still see the true
63       time rather than the shifted time.
64

AUTHORS

66       Alex Hornby <alex@hornby.org.uk>
67
69       Copyright � 2002,2008 Alex Hornby.  This  is  free  software;  see  the
70       source  for copying conditions. There is NO warranty; not even for MER‐
71       CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
72

SEE ALSO

74       date(1) time(2) gettimeofday(2)
75
76
77
78
79Alex Hornby                           1.0                         dateshift(1)
Impressum