FAKETIME(1)
๐ faketime(1) ๐
okay so you opened the faketime(1) page from the wolfcw manual, section 1, and honestly? bestie, you're about to have the most fun a clock has ever had. let's get into it ๐ฐ๏ธโจ
โจ NAME โจ
faketime โ literally just messing with the system time for one specific command. that's it. that's the whole vibe ๐
๐ธ SYNOPSIS ๐ธ
faketime [options] timestamp program [arguments...]
๐ฆ DESCRIPTION ๐ฆ
so here's the tea โ โ the command you hand over gets tricked into believing the current system time is whatever you put in timestamp. no cap. and it's not just time() being lied to, either: filesystem timestamps also get reported relative to that timestamp. cute, right? ๐
the wall clock keeps running from that date and time you gave it, unless you say otherwise โ that's the advanced options territory, we'll get there, don't worry ๐ซถ
under the hood, faketime is really just a simple little wrapper around libfaketime, which uses the LD_PRELOAD mechanism to load a small library that intercepts system calls to functions like time(2) and fstat(2). iconic behavior, honestly.
heads up tho โ this wrapper only exposes a subset of libfaketime's functionality. for the full menu please go read theREADMEfile that came withfaketimefor more details and advanced options, or peek athttps://github.com/wolfcw/libfaketime๐
๐ OPTIONS ๐
--helpโ shows the usage info and dips out. bye ๐--versionโ shows version info and also dips out.-mโ uses the multi-threading variant of libfaketime. multitasking queen energy ๐ง-p<PID>โ pretend the program's process ID is PID. (this one's only available if it was built withFAKE_PID, so don't come for me if it's missing ๐)-fโ use the advanced timestamp specification format. the fancy one. the main character one ๐--exclude-monotonicโ do not fake the time when the program makes a call toclock_gettimewith aCLOCK_MONOTONICclock. hands off that one ๐ซ--disable-shmโ disables libfaketime's use of shared memory.--date-prog<PATH>โ use a specific GNU-date-compatible implementation of the helper that transforms "timestamp format" strings into programmatically usable dates, instead of a compile-time default guess for the generic target platform. iykyk ๐ฅ
๐ EXAMPLES ๐
faketime 'last Friday 5 pm' date
faketime '2008-12-24 08:15:42' date
faketime -f '+2,5y x10,0' bash -c 'date; while true; do echo $SECONDS ; sleep 1 ; done'
faketime -f '+2,5y x0,50' bash -c 'date; while true; do echo $SECONDS ; sleep 1 ; done'
faketime -f '+2,5y i2,0' bash -c 'while true; do date ; sleep 1 ; done'
In this single case all spawned processes will use the same global clock without restarting it at the start of each process. ๐ฏโโ๏ธ๐ซ
(Please note that it depends on your locale settings whether.or,has to be used for fractional offsets) โ the little comma/period drama we all love ๐ญ
๐ ADVANCED TIMESTAMP FORMAT ๐
okay so the simple timestamp format (the default one) just applies the /bin/date -d command to parse user-friendly specs like 'last friday'. easy, adorable, works.
but when you use the -f option, the timestamp you typed on the command line is passed directly to libfaketime, and that unlocks a whole extra set of features โ like speeding the clock up or slowing it down for the target program. slay. it is strongly recommended that you have a look at the libfaketime documentation before going wild with this. here's the summary:
โ๏ธ Freeze clock at absolute timestamp: "YYYY-MM-DD hh:mm:ss"
if you want an absolute point in time, exactly this format must be used. and listen โ freezing the clock is usually not what you want, and it may absolutely break the application. only use if you know what you're doing! โ ๏ธ๐
โฉ Relative time offset: "[+/-]123[m/h/d/y]", e.g., "+60m", "+2y"
this is the most often used format and it specifies the faked time relatively to the current real time. the first character of the format string must be a + or a -. the numeric value by default represents seconds, but the modifiers m, h, d, and y can be used to specify minutes, hours, days, or years, respectively.
for example, "-2y" means "two years ago". ๐ซ
fractional time offsets can be used too โ e.g. "+2,5y", which means "two and a half years in the future". but please note that the fraction delimiter depends on your locale settings, so if "+2,5y" doesn't work, try "+2.5y" instead. annoying, i know, but we move ๐ซ
๐ Start-at timestamps: "@YYYY-MM-DD hh:mm:ss"
the wall clock will start counting at the given timestamp for the program. this is how you specify absolute timestamps without freezing the clock. much better, honestly โจ
๐ฅ ADVANCED USAGE ๐ฅ
when you're using relative time offsets or start-at timestamps (that's the ADVANCED TIMESTAMP FORMAT section above, plus option -f), you can adjust the clock speed โ meaning time can run faster or slower for the executed program. wild, right?
for example, "+5y x10" sets the faked time 5 years into the future and makes time pass 10 times as fast (one real second equals 10 seconds as measured by the program). โฑ๏ธ๐จ
similarly, you can slow the flow of time, e.g. "-7d x0,2", which sets the faked time 7 days in the past and sets the clock speed to 20 percent โ i.e. it takes five real-world seconds for one second measured by the program. slow burn aesthetic ๐๐
and again: depending on your locale, either "x2.0" or "x2,0" may be required regarding the delimiter. (we've been through this, i know ๐ญ)
you can also make faketime advance the reported time by a preset interval upon each time() call, independently from the system's time, using "-7d i2,0" โ where i is followed by the increase interval in seconds. periodt. ๐
faking times for multiple programs โ or even system-wide โ can be simplified by using ~/.faketimerc files and /etc/faketimerc. please refer to the README that came with faketime for warnings and details. ๐ซถ
and one more thing: faking of filesystem timestamps may be disabled by setting the NO_FAKE_STAT environment variable to a non-empty value. โจ
๐ AUTHOR ๐
Please see the README and NEWS files for contributors. (yes, the actual author credit lives over there, go show them love ๐)
๐ BUGS ๐
alright, deep breath, here's the fine print โ because of limitations of the LD_PRELOAD mechanism, faketime will not work with suidroot and statically linked programs. sorry, that's just how it is ๐
while timestamps and time offsets will work for child processes, speeding the clock up or slowing it down might not work for child processes spawned by the executed program as expected โ a new instance of libfaketime is used for each child process, which means that the libfaketime start time (the thing used in speed adjustments) will also be re-initialized. so the vibe resets. annoying but true ๐ญ
some programs may dynamically load system libraries, such as librt, at run-time and therefore bypass libfaketime entirely. rude.
you may report programs that do not work with libfaketime โ but only if they are available as open source. that's the deal ๐ค
๐ REPORTING BUGS ๐
Please use https://github.com/wolfcw/libfaketime/issues โ the issue tracker is right there, bestie, use it ๐ซถ
๐ COPYRIGHT ๐
Copyright ยฉ 2003-2021 by the libfaketime authors.
there is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. like, none. zero. โจ
you may redistribute copies of faketime under the terms of the GNU General Public License. for more information about these matters, see the file named COPYING. ๐
โญ SEE ALSO โญ
and that's the whole page, bestie ๐ faketime 0.9.13, dated August 2026 โ go forth and lie to clocks responsibly, ily, mwah ๐๐ฆ๐
๐ฆ where this page comes from
- alpine 3.24: libfaketime-doc 0.9.13-r0 ยท GPL-2.0-or-later
- arch rolling: libfaketime 0.9.13-1 ยท GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms