I think the main issue with this question is that it doesn't specify which version of Unix or Linux is being used, and the correct answer is going to depend on that. The accepted answer seems to assume a Debian-flavoured Linux using systemd. The top answer seems to assume a version of
date
that accepts -s
, which FreeBSD/macOS commonly doesn't.