2,000th topic

Programming, for all ages and all languages.
Post Reply
User avatar
Primis
Member
Member
Posts: 62
Joined: Fri May 14, 2010 3:46 pm
Libera.chat IRC: Primis
Location: New York, NY
Contact:

2,000th topic

Post by Primis »

Since this is the 2,000th topic in this forum :D, lets talk about the Y2k bug, or more specifically what caused it. So I ask, how do you keep track of the time and date in your OS?
Last edited by Primis on Tue Aug 24, 2010 7:21 pm, edited 1 time in total.
"On two occasions I have been asked, 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."
Image
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: 2,000th topic

Post by gerryg400 »

Since this is the 2,00th topic
That would be the Y0.2K bug.

Seriously though, to save space in my kernel, I use a single bit to represent the number of years since 2009. I've been testing for more than 12 months now and have seen no problems with this approach so far.
If a trainstation is where trains stop, what is a workstation ?
User avatar
Primis
Member
Member
Posts: 62
Joined: Fri May 14, 2010 3:46 pm
Libera.chat IRC: Primis
Location: New York, NY
Contact:

Re: 2,000th topic

Post by Primis »

Whoops, typo! Fixed it though. So is that a signed bit or non? you would think people would want to access dates prior (think 30 year loan tracker).
"On two occasions I have been asked, 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."
Image
roboman
Posts: 24
Joined: Fri Feb 27, 2009 9:41 am
Location: USA
Contact:

Re: 2,000th topic

Post by roboman »

From the jump table, item 65:

GetDate rd 1 ; 65. return : EAX=century, year, month,day, each a byte in bcd format.
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re: 2,000th topic

Post by Candy »

At the moment, it's going to tell you "not implemented".
User avatar
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

Re: 2,000th topic

Post by thepowersgang »

I'm just going to combo break these joke answers and give actually how I do it :)

My current method is to internally keep a Signed 64-bit count of milliseconds as the primary timestamp format. There is also a 32-bit "part-milliseconds" count that is used in the timekeeping code.
(Which makes the internal representation a 64.32 millisecond count)
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Post Reply