Add Stardate script

This script is used across various systems in:
- screen hardstatus line
- tmux status line

The script provides a simplistic Stardate calculator, not based
on any particular methodology of the Star Trek series, but on
a simple calculation based off GMT time.

The firt 2 digits are the number of years since 1970, the next
three digits and the digit after the decimal point indicate the
"stardate" of the year, which is a straightforward multiplication
by ~2.73785 which is 1000 stardates per calendar year which is an
average of 365.25 days.
vimbundler
nirenjan 2013-01-11 23:36:58 -08:00
parent e25a665905
commit d08390d4be
1 changed files with 14 additions and 0 deletions

14
stardate 100755
View File

@ -0,0 +1,14 @@
#!/usr/bin/perl
my $trek_year;
my $sd;
($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
gmtime(time);
$trek_year = ($year - 70) * 1000;
$sd = ((($yday)*1000/365.25 + $trek_year));
printf "%.1f\n", $sd;