|
NAMEstardate - convert between stardates and other calendarsSYNOPSISstardate [ options ] [ date ... ]DESCRIPTIONstardate interprets the dates specified on its command line, and outputs them in the formats specified by the options.If no dates are specified, the current time, read from the system clock, is used. If no options are specified, dates are output in the form of stardates. Consequently, if stardate is invoked with no arguments, it outputs the current time as a stardate. This performs much the same job as date(1), but with a more interesting form of output. Dates on output are always rounded down, and so in some cases will generate different output if reused as input. This rounding is always such that the output date is the latest time, expressible in the format being used, that is no later than the time specified as input. This program handles dates from 0001=01=01 (Julian calendar) up to (currently) (2^64 - 1) seconds later, which is beyond the year (5 x 10^11). Any date within this range can be input or output in any of the formats the program supports. Consequently, any date the program outputs will be accepted as input. The only exception is for dates within the first half second of the acceptable range, where the value output in the quadcent calendar, ``0000*12*31T02:03:16'' (chosen due to the rounding mentioned above), is actually outside the acceptable range. The stardate code is based on information in version 1 of the Stardates in Star Trek FAQ, which is regularly posted to the USENET newsgroup rec.arts.startrek.tech. OPTIONS
When 2 decimal places are used, the output of the current time changes every 172.8 seconds. (Actually, because of the resolution of C time, four-fifths of the changes are 173 seconds after the previous change, and the other fifth are 172 seconds after.)
This calendar is explained in detail in the Stardates in Star Trek FAQ. Briefly, it uses seconds that are approximately 1.00066 SI seconds long, and has no leap years. Each 400 years in this calendar is exactly as long as 400 years in the Gregorian calendar, but all years in the quadcent calendar are the same length.
INPUT FORMATSdates may be specified in any of the output formats, as described above, with a few variations allowed. More precisely, the following forms are permitted:
Stardate ``[0]0000.0'' is midnight UTC on 2162-01-04; negative issue numbers indicate times before that. If issue is less than 20, the number must be in the range [0, 10000). If equal to 20, [0, 5006). If greater than 20, [0, 100000). The FAQ explains these range changes.
Case of alphabetic characters in input is ignored. AUTHORAndrew Main <zefram@fysh.org>SEE ALSOdate(1), Stardates in Star Trek FAQBUGSThis program will not handle dates BCE.
Visit the GSP FreeBSD Man Page Interface. |