Function Repository Resource:

StarDate

Source Notebook

Convert real dates into "stardates"

Contributed by: Michael Sollami

ResourceFunction["StarDate"][date]

returns a StarDate string representing the given date object.

Details and Options

ResourceFunction["StarDate"] uses the convention developed for the 2009 film Star Trek.
A stardate is a fictional system of time measurement developed for the television and film series Star Trek. In the show, stardates are mathematical formulas which may vary depending on location in the galaxy, velocity of travel, and other factors, and can also vary widely from one episode to the next.

Examples

Basic Examples (3) 

Compute today's stardate:

In[1]:=
ResourceFunction["StarDate"][Today]
Out[1]=

Compute the stardate of a given date (February 11, 2258):

In[2]:=
ResourceFunction["StarDate"]@DateObject[{2258, 2, 11}]
Out[2]=

Find the stardate on a wine bottle:

In[3]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/10452e13-3d4f-42d1-806c-da65a4fc2b0c"]
In[4]:=
vintage = ResourceFunction["StarDate"]@
  StringTake[
   TextRecognize[FindImageText[img, "Word", "AlignedImage"][[9]], RecognitionPrior -> "Word"], 4]
Out[4]=

Scope (2) 

StarDate uses a date interpreter for String arguments:

In[5]:=
ResourceFunction["StarDate"]["jan 12 2020"]
Out[5]=

StarDate works on a DateObject by using DateList:

In[6]:=
d = {DateObject[{2409}], DateObject[{2409, 1, 2}], DateObject[{2900, 6, 18}]};
In[7]:=
ResourceFunction[
  "PrettyGrid"][{"Date Object" -> #, "Date List" -> DateList@#, "Star Date" -> ResourceFunction["StarDate"]@#} & /@ d]
Out[7]=

Possible Issues (2) 

Stardates used in the television series such as "The Next Generation" and others were not well-defined, as you can see with the option Method"TNG":

In[8]:=
Table[ResourceFunction["StarDate"][DateObject[2355], Method -> "TNG"],
  5]
Out[8]=

Interpreted strings will default to the current date values:

In[9]:=
ResourceFunction["StarDate"]["jan 31"]
Out[9]=

Publisher

Michael Sollami

Version History

  • 1.0.0 – 20 April 2020

License Information