Version 4 of Star Trek

Updated 2003-10-28 12:30:23

A sci-fi TV show, later turned into a long movie sequel.

Mentioned here for some obscure reason. Maybe they used Tcl in the Enterprise...

...it turns out that Tcl's clock scan supports Star Trek's stardate notation:

 % clock scan "stardate 20 . 20"
 -756604800

I've no idea who added this or why. I cannot see it in the documentation either. Strikes me as needless code bloat. Does *anyone* use this?

RS Also:

 43258 % clock format [clock sec] -format %Q
 Stardate 57824.5

-

The source for "strftime.c" reveals that the undocumented %Q format specifier is done as a special case:

    /* ... from strftime.c ... */
    if (format[0] == '%' && format[1] == 'Q') {
        /* Format as a stardate */
        sprintf(s, "Stardate %2d%03d.%01d",
                (((t->tm_year + TM_YEAR_BASE) + 377) - 2323),
                (((t->tm_yday + 1) * 1000) /
                        (365 + IsLeapYear((t->tm_year + TM_YEAR_BASE)))),
                (((t->tm_hour * 60) + t->tm_min)/144));
    /* ... */

 (bin) 50 % clock format [clock sec] -format "%Q blah"
 Stardate 57547.3
 (bin) 51 % clock format [clock sec] -format " %Q blah"
  Q blah

Anyone know who/when/why introduced this curious feature?

Just before the Tcl/2k conference in Austin - ask Jeff Hobbs and/or Kevin Kenny...