From d08390d4be45ea1a7a3745b6882071b323573299 Mon Sep 17 00:00:00 2001 From: nirenjan Date: Fri, 11 Jan 2013 23:36:58 -0800 Subject: [PATCH] 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. --- stardate | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 stardate diff --git a/stardate b/stardate new file mode 100755 index 0000000..4a992a9 --- /dev/null +++ b/stardate @@ -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; +