(Solved) Setting system time from hardware clock

You have a problem with Salix? Post here and we'll do what we can to help.
Post Reply
User avatar
loukingjr
Posts: 247
Joined: 8. Aug 2010, 13:10
Location: Pittsburgh,Pa

(Solved) Setting system time from hardware clock

Post by loukingjr »

I have Salix 13.37 XFCE installed as a guest in VirtualBox. Everything works fine but, when I start the guest it takes what seems to be a long time to "set the time from hardware clock(localtime), (10-20secs). It also happens when it tries to save the system time on shutdown. Any thoughts on this?

thanks ahead of time.
Last edited by loukingjr on 18. Mar 2012, 23:30, edited 1 time in total.
there are three kinds of people in the world. those that can count, and those that can't.
iMac 2.8Ghz i7
User avatar
gapan
Salix Wizard
Posts: 6361
Joined: 6. Jun 2009, 17:40

Re: Setting system time from hardware clock(localtime)

Post by gapan »

Most probably an issue with virtualbox itself. What version are you running? See if you there is an option inside the virtualbox settings about setting the clock to utc or not.
Image
Image
User avatar
loukingjr
Posts: 247
Joined: 8. Aug 2010, 13:10
Location: Pittsburgh,Pa

Re: Setting system time from hardware clock(localtime)

Post by loukingjr »

gapan wrote:Most probably an issue with virtualbox itself. What version are you running? See if you there is an option inside the virtualbox settings about setting the clock to utc or not.
actually VB defaults to UTC. I may have set Salix to local when I installed it. Is there a way to change it in Salix itself?
there are three kinds of people in the world. those that can count, and those that can't.
iMac 2.8Ghz i7
User avatar
gapan
Salix Wizard
Posts: 6361
Joined: 6. Jun 2009, 17:40

Re: Setting system time from hardware clock(localtime)

Post by gapan »

System menu/System clock.
Image
Image
User avatar
loukingjr
Posts: 247
Joined: 8. Aug 2010, 13:10
Location: Pittsburgh,Pa

Re: Setting system time from hardware clock(localtime)

Post by loukingjr »

thanks much. It wasn't set to UTC and now that it is it's much better.
there are three kinds of people in the world. those that can count, and those that can't.
iMac 2.8Ghz i7
rsal
Posts: 198
Joined: 12. Mar 2012, 17:00

Re: (Solved) Setting system time from hardware clock

Post by rsal »

I know this is an old thread. I had similar problem so before posting I searched and found this. I could correct my problem with this post. But I want to know what is the command line equivalent of this (checking out UTC option in System menu > system clock) ? In other distributions I can change from UTC to LOCAL in /etc/adjtime. But in Salix, it reverts back to UTC on rebooting.
Last edited by rsal on 22. Jan 2016, 07:25, edited 1 time in total.
User avatar
gapan
Salix Wizard
Posts: 6361
Joined: 6. Jun 2009, 17:40

Re: (Solved) Setting system time from hardware clock

Post by gapan »

Code: Select all

sudo clocksetup
and if you mean what the actual code that sets the timezone is, this is it:

Code: Select all

	cd /etc
	if [[ "$zone" && -r /usr/share/zoneinfo/$zone ]]; then
		ln -sf /usr/share/zoneinfo/$zone localtime-copied-from
		rm -f localtime
		cp localtime-copied-from localtime
	fi
Image
Image
rsal
Posts: 198
Joined: 12. Mar 2012, 17:00

Re: (Solved) Setting system time from hardware clock

Post by rsal »

That is a good utility (also there in Slackware installation if I remember correctly). But why not simplify and just have settings in /etc/adjtime picked up at boot time? Well, every distribution is different and Salix is one of the best distributions.
rsal
Posts: 198
Joined: 12. Mar 2012, 17:00

Re: (Solved) Setting system time from hardware clock

Post by rsal »

What is the actual command that makes the system know that hardware clock is in UTC (or local) time.
User avatar
gapan
Salix Wizard
Posts: 6361
Joined: 6. Jun 2009, 17:40

Re: (Solved) Setting system time from hardware clock

Post by gapan »

rsal wrote:That is a good utility
Thank you!
rsal wrote:also there in Slackware installation if I remember correctly
No. That would be timeconfig.
rsal wrote:But why not simplify and just have settings in /etc/adjtime picked up at boot time?
That file is not to be edited by hand. hwclock can update it and read from it.
rsal wrote:What is the actual command that makes the system know that hardware clock is in UTC (or local) time.
You can edit your /etc/hardwareclock and use hwclock to apply any changes if you want to do everything manually, but I don't see a reason to do that.

Code: Select all

man hwclock
for more details.
Image
Image
Post Reply