Date & time

Hey, I have a problem with setting the time in freebsd. Every reboot of the machine I have the hour +1. Any advice on how I can rigidly set the hour or so that it doesn't reset every reboot of the machine?
 
The command you are looking for is tzsetup(8). As mer indicates it asks you for the bios time setting. As far as I remember Windows tends to set the time to local time. On other systems it is good practice to use UTC for the bios time setting and let the system add the correct offset.
 
The file /etc/localtime should reflect your timezone. I'm in NSW:
Code:
[gunsynd.155] $ ls -lad /etc/localtime /usr/share/zoneinfo/Australia/NSW
-r--r--r--  1 root  wheel  2190 Jul 29 14:57 /etc/localtime
-r--r--r--  1 root  wheel  2190 Apr  7  2023 /usr/share/zoneinfo/Australia/NSW
[gunsynd.156] $ cmp /etc/localtime /usr/share/zoneinfo/Australia/NSW && echo SAME                            <
SAME
I also use ntpd(8) to set time on boot and keep time while the system is running:
Code:
[gunsynd.159] $ grep ntp /etc/rc.conf
ntpd_enable="YES"
ntpd_sync_on_start="YES"
My FreeBSD system is a virtual machine, so don't allow ntpd(8) to panic if the VM has been woken up from a suspension, such as that which would occur with a vMotion:
Code:
[gunsynd.160] $ grep tinker /etc/ntp.conf
tinker panic 0                # VirtualMachine
 
The command you are looking for is tzsetup(8). As mer indicates it asks you for the bios time setting. As far as I remember Windows tends to set the time to local time. On other systems it is good practice to use UTC for the bios time setting and let the system add the correct offset.
It works, thx! <3
 
  • Like
Reactions: mer
Back
Top