1DATEFUDGE(1) Debian DATEFUDGE(1)
2
3
4
6 datefudge - pretend the system time is different
7
9 datefudge [-s|--static] [-l|--add-ld-preload lib] at_date program
10 [arguments ...]
11
13 datefudge is a small utility that pretends that the system time is dif‐
14 ferent by pre-loading a small library which modifies the time(2), get‐
15 timeofday(2) and clock_gettime(2) system calls.
16
18 The at_date argument can be given in any format accepted by the date(1)
19 program, for example "2007-04-01 12:21" or "yesterday", or "next Fri‐
20 day".
21
23 --static, -s
24 Mark the date as a `static' one. The above mentioned system
25 calls will always return the date given in the at_date argument,
26 regardless of time passing. See EXAMPLES below.
27
28 --add-ld-preload lib, -l lib
29 Prepend lib to LD_PRELOAD environment variable before executing
30 given program. This option might be useful for example to
31 inject sanitizer libraries (e.g. from Address Sanitizer) to the
32 list of preloaded libraries before the internal datefudge's
33 library. See EXAMPLES below.
34
35 --help, -h
36 Print short usage information and exit.
37
38 --version, -v
39 Print version information and exit.
40
42 Basic examples:
43 $ datefudge "2007-04-01 10:23" date -R
44 Sun, 01 Apr 2007 10:23:00 +0200
45
46 $ datefudge "1 May 2007" date -R
47 Tue, 01 May 2007 00:00:00 +0200
48
49 $ datefudge "2 weeks ago" date -R
50 Wed, 16 Jan 2008 13:32:12 +0100
51
52 Non-static vs. static example:
53 $ datefudge "2007-04-01 10:23" sh -c "sleep 3; date -R"
54 Sun, 01 Apr 2007 10:23:03 +0200
55
56 $ datefudge --static "2007-04-01 10:23" sh -c "sleep 3; date -R"
57 Sun, 01 Apr 2007 10:23:00 +0200
58
59 Prepending LD_PRELOAD example:
60 $ datefudge --add-ld-preload /path/to/libclang_rt.asan-x86_64.so "2007-04-01 10:23" command
61
62 If the command was compiled by 'clang -fsanitize=address -shared-libasan', then the above
63 command might display some errors, for example:
64
65 ==7625==ERROR: AddressSanitizer: heap-use-after-free on address 0x614000000044 at pc ....
66
67 Without the --add-ld-preload argument, this would not work at all.
68
70 Written by Matthias Urlichs <smurf@noris.de>. Modified by Robert
71 Luberda <robert@debian.org>.
72
74 There is no attempt to make this change undetectable by the program.
75 In particular, file modification times are not modified.
76
77 On systems using 32-bit representation of time, datefudge is affected
78 by the year 2038 problem, which might cause dates to be wrapped around,
79 for instance:
80 $ TZ=UTC datefudge "2038-01-19 03:14:07" sh -c "sleep 1; date -R"
81 Fri Dec 13 20:45:53 UTC 1901
82
84 Copyright © 2003 by Matthias Urlichs.
85 Copyright © 2008-2019 by Robert Luberda.
86
87 There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
88 PARTICULAR PURPOSE. You may redistribute copies of datefudge under the
89 terms of the GNU General Public License.
90 For more information about these matters, see the file named COPYING.
91
93 date(1), ld.so(1), time(2), gettimeofday(2), clock_gettime(2)
94
95
96
97datefudge 1.23 August 1th, 2019 DATEFUDGE(1)