[net.startrek] Source code for stardate program

rjnoe@ihlts.UUCP (Roger Noe) (07/12/84)

Some fellow readers of net.startrek have pretended to be interested
in the stardate program I sometimes use for my Star Trek correspondence.
While I know this is of limited value, I decided to post it anyway.
The C source follows . . .
---
				/* Number of seconds from		*/
#define	EPOCH	104538600	/* 20:30:00 EST, Thu. September 8, 1966	*/
				/* to the UNIX epoch of 00:00:00 GMT,	*/
				/* January 1, 1970.			*/
main()
{
double stardate;
stardate = (time((long *) 0) + EPOCH) / 86400.0;
printf("%.5f\n", stardate);
}

---
Simple, huh?  Basically all it does is measure the mean solar days from the
moment the first episode of Star Trek began airing on network TV and calls
them stardates.  The inverse (I call the above program sd and its reverse
unsd) is also easy to do.  I know there are a lot of algorithms which might
be arguably 'better' but I feel the above makes for a useful frame of reference
for Star Trek fan activities.  For example, the release stardates of the three
Star Trek movies are (approx.) 4838 (ST1: 12-7-79), 5748 (ST2: 6-4-82) and
6476 (ST3: 6-1-84).  An interval of 0.00001 stardate is slightly less than
a (mean solar) second.  Sure, we could get something a bit more meaningful
by switching to sidereal time and so forth, but this algorithm seems good
from the standpoint of simplicity and utility.  It's a lot better than
calling today's stardate something like 8407.11, like they do on those
calendars.  Oh, I almost forgot to mention:  stardate 10000 is coming on
January 24, 1994 so I'm planning to have a big party then.  You're all
invited.  Watch this newsgroup for details.  I'll get around to posting
them about December, 1993 when "Star Trek VIII: The Destruction of the
Federation" is released.  (Star Trek IX tells how Kirk single-handedly
raises everyone from the dead and then dies himself--of old age.)
--
"The more they overthink the plumbin', the easier 'tis to stop up the drain."
	Roger Noe			ihnp4!ihlts!rjnoe