This will only work if you're setting your BIOS time to UTC.
That's true, because UNIX does not support any other kind of time. All the things that users think of as "timezones" are local display affectations; the underlying value of the system's time_t is the number of seconds since the epoch, UTC. This means that (time_t) 1666197892 would be that same value whether your server is in the US, Brazil, India, Russia, or on the moon. Displaying this value as Wed Oct 19 11:44:52 CDT 2022 in the US Central timezone is the result of an algorithm that generates this complicated string, but the underlying time is also Wed Oct 19 16:44:52 UTC 2022, just printed differently (what I mean when I say "local display affectation").
Due to the original design limitations of the PC architecture, there is no timezone setting in your BIOS, which makes it complicated to pick up the time from the BIOS to begin with. BSD historically included some sort of hack as part of the installer to try to compensate for this; I cannot recall what the details are, and I'm too lazy to look it up.