I'm surprised I don't find anything on changing the (Linux) system time from Rust.
Specifically, right now I have a chrono::NaiveDateTime struct which I want to set as my new system time, then update the RTC. On the command line, I would do:
Changing the time of day is a privileged operation (the exact privilege is CAP_SYS_TIME on Linux).
Just call a function won't work as it will error out with EPERM.
If you really want to do this, I recommend you use setcap to give you programs only CAP_SYS_TIME instead of setid-ing it, as setid give all permission. But I honestly, I strongly recommend against messing with privileged stuff without a really good reason.