# Time zone error...



## KenGordon (Mar 2, 2021)

So....I have installed FreeBSD 12.2-STABLE on a machine, just to see how it will behave, and although during the install process I set the time zone to Pacific (Los Angeles), as the system is loading, I see error messages such as "Time Skew detected" and "Setting to UTC", and such like. Then something messes with my BIOS and sets THAT to UTC. I assume (bad idea, I know) that there is some setting somewhere in the boot process which has the incorrect info in it.

So, if I am correct in the last assumption, where is this and how do I fix it? Anyone?

Ken Gordon,


----------



## Jose (Mar 2, 2021)

KenGordon said:


> So....I have installed FreeBSD 12.2-STABLE on a machine, just to see how it will behave, and although during the install process I set the time zone to Pacific (Los Angeles), as the system is loading, I see error messages such as "Time Skew detected" and "Setting to UTC", and such like. Then something messes with my BIOS and sets THAT to UTC. I assume (bad idea, I know) that there is some setting somewhere in the boot process which has the incorrect info in it.
> 
> So, if I am correct in the last assumption, where is this and how do I fix it? Anyone?
> 
> Ken Gordon,


Do you dual boot Windows? Windows will set the CMOS clock to local time. Freebsd and all the unix work-alikes I've used set it to UTC.


----------



## a6h (Mar 2, 2021)

Put this in rc.conf, [reboot], check it again, and report back.

```
ntpdate_enable="YES"
ntpd_sync_on_start="YES"
```


----------



## KenGordon (Mar 2, 2021)

First of all, I don't dual boot from one HD. I have two separate HDs, one with WIn10 and the other with FreeBSD. Windows "tries" to set the clock to local time, but fails.

I'll try the above, and, as usual, thanks a bunch. You folks are pretty wonderful,,

Ken Gordon


----------



## Jose (Mar 2, 2021)

Hard drive doesn't matter, the CMOS lives on the motherboard.
I find it easier to get Freebsd to play nice with Windows rather than the other way around. If you want to do that, the trick is to `doas touch /etc/wall_cmos_clock`. See adjkerntz(8) for details.
There are suggestions on this thread if you want to make Windows use a UTC CMOS clock:








						Adjust time when dual booting with Windows 10 (CMOS clock set to local time)
					

AFAIK, FreeBSD prefers the hardware (CMOS) clock to be set to UTC, but it is possible to select that it is set to local time during the installation.  That is what I did, as I am dual booting (actually, triple) FreeBSD with Windows 10 (and Void Linux). Now the time displayed is incorrect in...




					forums.freebsd.org


----------



## SirDice (Mar 2, 2021)

Yeah, if you dual-boot with Windows don't set the CMOS clock to UTC in FreeBSD. An easy way to set the timezone again (including the option to use UTC or not) is to run tzsetup(8).


----------



## eyoung100 (Mar 3, 2021)

Read: How to Fix Windows and Linux Showing Different Times When Dual Booting and use option 2.  I have 2 linuxes, Windows 10, and FreeBSD all seeing my local time with my UEFI settings system clock set to UTC.  Even though the link is about Linux, it works for all OS'es that calculate time by using the GMT offset.


----------



## KenGordon (Mar 5, 2021)

Thanks folks. So far, it is looking as though it is fixed....for now. My problem is kinda the opposite of what is mentioned above: I want both my Windows install and my FreeBSD install to be set to local time, but despite my setting the time zone correctly when installing FreeBSD, it set "itself" to UTC and that was fouling up the Windows time. 

After doing as Vigole suggested above, it seems to have fixed the problem.

Later,

Ken Gordon


----------



## Mjölnir (Mar 5, 2021)

IIRC the system's (kernel's) internal time is always set to UTC; that might shine through some error messages & confuse the innocent user/sysadmin - remember the average devs are pimply, nerdy bit fiddlers to whom their own messages are, naturally, cristal clear.  Setting the TZ only set's the offset to use when reporting time for utilities like date(1) etc.


----------



## a6h (Mar 5, 2021)

KenGordon said:


> I want both my Windows install and my FreeBSD install to be set to local time


Just one thing about Windows part: Just make sure Auto Sync is enabled (it's similar to FreeBSD settings in rc.conf)
`Date and Time | Internet Time | Change settings | Check the "Synchronise"`
This way you can make sure even if there's some problem, Windows will correct its time eventually.

P.S. I'm running triple boot machine, and time settings works fine in all OSs.
* BIOS/GPT
* BCD (Windows) + boot2 (FreeBSD) + GRUB (Linux)
* Windows (2 primary partitions) + FreeBSD (1 slice aka partition) + Linux (installed on extended partition).
If Windows didn't waste one extra partition (system), I could have a _quadruple_ boot (OpenBSD).

Footnote: To be precise, actually I have a _quintuple_ boot, if I count the BCD-based boot toggle between _hyper-v_ and _haxm_!


----------

