[arachne] Re: Getting the BIOS date from a PC

Arachne at FreeLists---The Arachne Fan Club!

On Fri, 13 Mar 2009, Samuel W. Heywood wrote:

This web page explains how to get the BIOS date
out of any PC running DOS or Windoze:

http://www.anderbergfamily.net/ant/biosdate/

If anybody here knows of a similar nifty program
that will do that for a PC running linux, then
please let me know.

  hwclock shows the hardware clock (BIOS time).
  date shows the system time.

$ /sbin/hwclock --show; date
Fri 13 Mar 2009 10:38:39 AM EDT
Fri Mar 13 10:37:56 EDT 2009

BIOS time can drift quite a bit since hardware clocks are notoriously inaccurate. From the above, you can see that BIOS/system times are out of sync on this machine (uptime 91 days) by 42 seconds. Let's fix that:

$ sudo rdate -s time-a.nist.gov; sudo hwclock --systohc

System clock is synced with one of the NIST atomic clocks. Then hardware clock is synced to system clock.

  Now all the clocks agree within milliseconds.

$ /sbin/hwclock --show; date
Fri 13 Mar 2009 10:41:25 AM EDT
Fri Mar 13 10:41:25 EDT 2009

I have a cron job on the FreeBSD machine update the time once a week I think it is; this (Debian) desktop machine... whenever the time gets far enough off that I notice it. Arachne at FreeLists -- Arachne, The Premier GPL Web Browser/Suite for DOS --

Other related posts: