Re: Calendar Info Needed

new topic     » goto parent     » topic index » view thread      » older message » newer message

-----Original Message-----
From:   Leung, Ying-Kit [SMTP:Ying-Kit.Leung at CAN.XEROX.COM]
Sent:   Wednesday, June 16, 1999 2:12 PM
To:     EUPHORIA at LISTSERV.MUOHIO.EDU
Subject:        Calendar Info Needed

>I've a question for you: Does anybody know how the calendar in a PC, say
>windows
>9x/NT works? I mean, how does the computer know the date/day? I know they
>use the
>battery to "remember".  But where does the info stored, and in what
format?


PC's All have a special chip in them which acts like a digital watch, this
chip is called the RTC (Real Time Clock). You can program the current date
and time (like setting your watch), from then on it runs by itself even
when the main power is switched off (powered by the battery you mention).
 The PC can then access this information at any time it wishes.

BTW some PC clock chips can keep track of the current day of the week, but
this IMHO is not a lot of use if you are manipulating dates in the
future/past.

NB. Any thing more than this information and you must program it yourself.

If you want to workout what the day of the week, or if 2000 is a leap year,
then it all need's to be calculated, by your program.  The algorithms for
date&time manipulation are readily available on the Internet. I can dig a
few URL's out if you get stuck.  or even just post some old C & Pascal code
I once wrote.

>If you're using a GUI now, there's a date available to you to access
>somewhere.

No matter if you are using dos or a GUI accessing the RTC will be the same

>How are these info stored/programmed in a computer? Is it programmed
>somewhere
>in the ROM?

The RTC can be accessed  directly through ports 70 and 71 hex

>is it possible to access it with Euphoria?

I guess so smile

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu