Timekeeping in ANSI C

gary sarff gsarff at argus.UUCP
Sat Feb 20 05:16:48 AEST 1988


I agree that the system and software should be as flexible as possible pretty
much regardless of how much trouble it will be for the implentors.  (Up to
some point anyway.)  The naivete of some programmers regarding date/time
information is suprising.  I was using a data base program on a mini at
work and there was a date field for personnel birthdates.  Unfortunately
it was only two digits long, and the programmer tried to catch errors in
entry, but for a reason that became apparent after a moment's thought we
could not enter the birthdate of someone who was born in 1919.  Because
the programmer had written error code such that if the first two digits
were 19 he thought the operator had ignored the instructions and put in
something like 1945 or such, not thinking that people born in 1919 are not
yet even 70 years old and may be around for some time to come.  It took
months to get the company to fix this, they thought it was a "feature"
thank goodness it was only application code and not an OS.  The time format
on the OS I use at work (a proprietary os called WMCS from WICAT SYSTEMS
based on VMS) uses two bytes for the year, two bytes for the day in the
year, and a byte each for hours, minutes, seconds, and 100ths of a second
for both absolute time and time since boot of the system, two tick clocks.

-- 
Gary Sarff           {uunet|ihnp4|philabs}!spies!argus!gsarff
To program is human, to debug is something best left to the gods.
"Spitbol?? You program in a language called Spitbol?"
  The reason computer chips are so small is that computers don't eat much.



More information about the Comp.lang.c mailing list