Re: Calendar Info Needed
- Posted by "Carl R. White" <C.R.White at SCM.BRAD.AC.UK> Jun 16, 1999
- 414 views
On Wed, 16 Jun 1999, Leung, Ying-Kit wrote: ] 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? The BIOS in your computer holds the date and time, usually in a proprietary format, BIOS for BIOS. DOS (or whatever other operating system you use) polls the BIOS for the date and time on startup, so that it can align itself with the machine. An example BIOS date could look like this: Hex: 10 06 07 CF CD 14 63 | | | | | | 16/06/1999 52500 seconds since midnight The high bit of the '63' byte represents whether 65536 seconds have passed since midnight. If set, 65536 should be added to the total seconds count. The lower order bits represent 100ths of a second. In this case, the time translates as 14:35:00.99, if I've done my sums right :) IIGC Euphoria gets the date info from DOS/Windows. If you're after writing a calendar program, I'm sure there's something available on the Euphoria Contributions pages that'll have an algorithm for dealing with dates. FWIW, I never got around to translating my Calendar programs into Euphoria. There buried somewhere on my hard drive in QBasic. I might just dust them off and translate them... HTH, Carl -- Carl R White -- Final Year Computer Science at the University of Bradford E-mail........: cyrek- at -bigfoot.com -- Remove hyphens. Ta :) URL...........: http://www.bigfoot.com/~cyrek/ Uncrackable...: "19.6A.23.38.52.73.45 25.31.1C 3C.53.44.39.58"