FAKE-HWCLOCK(8)
π fake-hwclock(8) β the "my computer has no clock so we're faking it" page π
okay bestie, sit down, because this one is a lifesaver and it lives in section 8 of the System Manager's Manual. it's called fake-hwclock and it's literally "Control fake hardware clock". yes. fake. we're faking it. and we're eating.
β¨ NAME β¨
fake-hwclock β Control fake hardware clock π°οΈβ¨
π«Ά SYNOPSIS π«Ά
fake-hwclock [ command ] [ force ]
like... that's it. that's the whole vibe. a command, maybe a force, we move on π
πΈ BACKGROUND πΈ
so here's the tea π΅. many embedded Linux systems do not have a functional hardware clock. like, at all. either:
- they simply don't have a hardware clock, periodt π
- or they do have one but it's not usable β e.g. because Linux doesn't know how to use it, or because there's no battery in it πβ
and the consequence? this is the bad part, bestie. time can move backwards to some default value (often 1970 π) when the system is rebooted. and because lots of software just assumes that time only moves forward, this is a bad thing. like, main-character-level bad.
NTP can (and should, where practical) be used to sync with an external timeserver π β but here's the thing: it is not available early in the boot process, and it may be unavailable for other reasons too. so NTP is not enough on its own. rude of it, honestly.
so what's the design expectation of fake-hwclock? it gets run very late at shutdown and very early at boot. that way fsck has a vaguely sensible idea of system time at boot and won't be out here complaining that the last-modified time in the filesystem is not hugely in the past or future π. fsck is so dramatic.
some users may not worry about this use case β in which case it is possible to modify the init system configuration to move things earlier/later as appropriate. customize your timeline, queen π
π DESCRIPTION π
fake-hwclock sets and queries a fake "hardware clock" which stores the time in a file. the clock isn't real but the file is. we improvise. we adapt. we slay.
this program may be run by the system administrator directly, but it is typically run by:
- init β to load the time on startup and save it on shutdown π
- cron β to save the time hourly β°
and here's the fun lil default: if no command is given then fake-hwclock acts as if the save command was used. no notes. it just does it. iconic behaviour honestly.
π COMMANDS π
saveβ Save the time to the file πΎ. but the way it's got a sanity check:fake-hwclockwill not move the saved clock backwards to a time/date earlier than its own release date. so no time-travelling before this program even existed, bestie, we have standards. useforceto over-ride this check π€loadβ Load the time from the file π. ifforceis specified,fake-hwclockwill move the clock either backwards or forwards. otherwise it will only move it forwards. forward only, no looking back, that's the energy β¨
π FILES π
/etc/fake-hwclock.dataβ the file used to store the time ποΈ/etc/init.d/fake-hwclockβ the init script used to runfake-hwclockon startup and shutdown π/usr/lib/systemd/system/fake-hwclock-load.serviceβ systemd service used to runfake-hwclockon startup π/usr/lib/systemd/system/fake-hwclock-save.serviceβ systemd service used to runfake-hwclockon shutdown π/usr/lib/systemd/system/fake-hwclock-save.timerβ systemd timer used to save the time hourly β³/etc/default/fake-hwclockβ settings file for the init script βοΈ/etc/cron.hourly/fake-hwclockβ cron job used to save the time hourly π
π¦ ENVIRONMENT VARIABLES π¦
FILEβ set the file used byfake-hwclockπ
β RETURN VALUES β
1is returned for invalid commands π«0is returned in all other cases β
π BUGS π
not me having to be honest with you: this approach can only provide a crude approximation of what a real hardware clock provides. it's fake, bb, that was the whole premise.
use of NTP or another method to keep the time in sync is strongly advised. like, strongly. take the advice. π«Ά
okay that's the whole page, you're basically a clock expert now π°οΈπ
this has been Debian, dated 12 July 2026 β sending you love, sensible timestamps, and absolutely no 1970 energy. mwah πβ¨
π¦ where this page comes from
- ubuntu stonking: fake-hwclock 0.15
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms