The TCL command clock format contains a formatting option %Q. According to the manual, “This format group is reserved for internal use within the Tcl library.”
Trying it returns the current stardate.
% clock format [clock seconds] -format %Q
Another piece of trivia, Stardates in the original Star Trek don’t make any sense, and seem to have no correlation with actual time passing. Roddenberry himself once said that it didn’t make sense and he’d rather forget about the entire thing. In Star Trek TNG and Voyager they actually made the Stardate reflect the season of the episode. Stardate 45xxx was season 5, Stardate 49xxx was season 9, and it wrapped around so Stardate 50xxx was season 10. Using that system, the TCL Stardate format returns approximately the correct date for season 23 of TNG, if TNG was still on today that is (it started in 1987).