From a3f0b88de43e401546036cbaf1bfb1be450c804d Mon Sep 17 00:00:00 2001 From: nirenjan Date: Mon, 21 Jan 2013 12:00:38 -0800 Subject: [PATCH] Add stardate script based on Julian date --- scripts/sdate | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 scripts/sdate diff --git a/scripts/sdate b/scripts/sdate new file mode 100755 index 0000000..7426811 --- /dev/null +++ b/scripts/sdate @@ -0,0 +1,15 @@ +#!/usr/bin/env python +""" Calculate the Julian Date """ + +import time + +t = time.time() + +""" Technically, we should be adding 2440587.5, + however, since we are trying to stick to the stardate + concept, we add only 440587.5""" +jd = t / 86400.0 + 440587.5 + +# Use the idea that 10 Julian days is equal to 1 stardate +print "%05.1f" % (jd / 10) +