WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Motherboard clock battery problem  (Read 4251 times)

Offline ACRizona

  • Jr. Member
  • **
  • Posts: 61
Motherboard clock battery problem
« on: August 21, 2010, 11:38:37 PM »
The soldered-in battery is dead and the Mboard is too old for surgery. :'(
The old BIOS defaults to Jan 1, 2000 12:01:01 AM so,,, by the time it boots and I get  to terminal; date reports some random??? date & time +-  many hours from 1/1/2000 !

I installed ntpclient and tried;
sudo nptclient -s -c 1 -t -h local.veryfast.time.server
Now the date is correct, but the time is screwy. Repeating the command results in an even screwier time.   I suspect some weird mathematics here.

I tried chrony... I flipped my sand-clock over several times before I finally un-installed that thing !   

I typed the numbers according to my sun-dial into cpanel Date/Time and all is well.
Surely there is a simple script that I can add to the boot procedures that can set the proper date & time.

Any help is welcomed.   This old Wang computer thanks you.

 

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: Motherboard clock battery problem
« Reply #1 on: August 22, 2010, 12:36:59 AM »
And this little script is: getTime.sh

It's part of the Core so you won't need any extension for it to run. The only caveat is that the time source it utilizes might not provide the fractions of a second precision that ntp is able to provide.

Offline ACRizona

  • Jr. Member
  • **
  • Posts: 61
Re: Motherboard clock battery problem
« Reply #2 on: August 22, 2010, 01:02:31 AM »
Great !   (... how many times I've searched for gettime ... )

Erk !  Its several hours ahead of me ! 
Can I set that in GRUB script tz=GMT-7 ?
Where do I add getTime.sh in proper start-up sequence ?

Thanks for your help.


Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Motherboard clock battery problem
« Reply #3 on: August 22, 2010, 01:59:34 AM »
or you could also try
Code: [Select]
sudo rdate my.timeserver.com

using option -p would show you how the time would be set without actually setting it  ;)

If your clock is supposed to be kept in local time, you also have to add boot param 'noutc'
« Last Edit: August 22, 2010, 02:04:43 AM by tinypoodle »
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14817
Re: Motherboard clock battery problem
« Reply #4 on: August 22, 2010, 04:59:37 AM »
Can I set that in GRUB script tz=GMT-7

Note that "GMT-7" is the opposite to what you'd expect, it would more usually be named "GMT+7"...

Offline ACRizona

  • Jr. Member
  • **
  • Posts: 61
Re: Motherboard clock battery problem
« Reply #5 on: August 22, 2010, 05:05:09 PM »
No matter what I put in grub menu.lst ;    noutc and/or tz=gmt-7
when it boots, I see:

Booting TinyCore
Setting language to C Done
Setting TimeZone to UTC  Done

 ???

getTime.sh and sudo rdate -s both set the date 8 hours ahead of local time.

http://forum.tinycorelinux.net always displays the correct time :)

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Motherboard clock battery problem
« Reply #6 on: August 22, 2010, 05:26:39 PM »
Perhaps it's the use of lower case instead of caps for tz?
Is your hwclock supposed to be in utc or local or errrr, when you go into BIOS, does it work at all and can it be set?
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline ACRizona

  • Jr. Member
  • **
  • Posts: 61
Re: Motherboard clock battery problem
« Reply #7 on: August 22, 2010, 06:09:34 PM »
tz=GMT-8  or tz=gmt-8 or tz=UTC-8 ,,, same results.

The Mboard clock works fine.  Without a battery,
the clock always starts at  Jan 1, 2000 00:00:00 AM.

I added getTime.sh and hwclock -w to bootlocal.sh  so when it boots,  the true UTC date & time are set.

Now... I need the LocalTime ! 
« Last Edit: August 22, 2010, 07:33:43 PM by ACRizona »

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: Motherboard clock battery problem
« Reply #8 on: August 23, 2010, 06:00:13 PM »
Hmm, it looks like you are going about setting your local timezone in the wrong way. As there are already several threads regarding this, I'd like to point out just a few contributions of myself towards a better understanding:

So, if you live in an area of the Mountain Time that does not use daylight savings (e.g. Phoenix) your TZ value would be MST7, and where DST is used (e.g. Denver) the setting would be MST7MDT,M3.2.0,M11.1.0

Offline ACRizona

  • Jr. Member
  • **
  • Posts: 61
Re: Motherboard clock battery problem
« Reply #9 on: August 23, 2010, 08:18:09 PM »
Several threads ???  There are 5 PAGES of them when you search the forum for TZ.
I know, I have read them all.

I have found a solution elsewhere that uses rdate and hwclock to set the exact Phoenix time.