dotfiles/scripts/stardate

17 lines
357 B
Python
Executable File

#!/usr/bin/env python3
""" Calculate the Julian Date """
import time
import math
t = time.time()
""" Technically, we should be adding 2440587.5,
however, since we are trying to stick to the stardate
concept, we add only 40587.5"""
jd = (t / 86400.0 + 40587.5)
# Use the idea that 1 Julian day is equal to 1 stardate
print(("%05.9f" % jd)[:-7])