Newsgroups: comp.std.internat
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!casbah.acns.nwu.edu!hpa
From: hpa@casbah.acns.nwu.edu (H. Peter Anvin)
Subject: Re: What time is it? [Was: Data compression standard]
Message-ID: <1991Jun25.173245.8415@casbah.acns.nwu.edu>
Organization: Northwestern University
References: <shores.677707660@fergvax> <1991Jun25.001607.28886@redsox.bsw.com> <ENAG.91Jun25161013@gyda.ifi.uio.no>
Date: Tue, 25 Jun 1991 17:32:45 GMT
Lines: 41

In article <ENAG.91Jun25161013@gyda.ifi.uio.no> of comp.std.internat,
  enag@ifi.uio.no (Erik Naggum) writes:
> Lessee, it's June 25th, 1991, 3:51pm local time, or 19910625135127.
> Alternatively it's 1991-06-25 15:51:27 +02:00.  From both a machine-
> and human-readable point of view, delimiters can be very helpful in
> disambiguating syntaxes.  A string of digits is not much different
> from a string of bits, as I see it.  Especially as the string gets
> longer, it's hard for humans to sort out what's what.  Pick out the
> day of the month from 19910625135127 and 1991-06-25 15:51:27, as a
> simple exercise.
> 
> Further, I don't want to see heuristics added to the parsing algorithm
> in order to find out what time was _really_ intended.  E.g. is
> 91-06-25 a date 1900 years ago or just a sloppy syntax? 

A standardized non-computer-related way of codifying dates in numeric form
is the Julian day number.  It is designed to be zero on noon UTC, 0 Jan
4711 B.C. if I remember it right ("0 Jan" is astronomese for 31 Dec the
year before).  It increments by one every 24 hours; an arbitrary number of
decimals (or binals) can be added to the number for arbitrary precision.
Presume you need millisecond precision.  There are 86,400,000 ms in a day,
so you need either 8 decimals or 27 binals.  There are roughly 2,500,000
days since the zero point, so in order to describe that range and cover the
same time span into the future (to sometime in the 68th century) you need 7
digits or 23 bits.  Total: 15 digits or 50 bits.  If you can cut down to
centisecond performance, only 14 digits or 46 bits.

Check in an astronomical book or table to check out the exact Julian day
number epoch; quite some astronomical literature lists the Julian day
number for the first day of the year.

Personally, I think the JDN would fit very well in a 48-bit, 2's-complement
format with subcentisecond precision: 24 binals, 24 integer bits.  Could
cover almost 46,000 years ranging from 27,000 B.C. to 18,000 A.D.

	/Peter 


-- 
MAIL: hpa@casbah.acns.nwu.edu   (hpa@nwu.edu after this summer)
"finger" the address above for more information.
