Created
September 15, 2014 17:55
-
-
Save petrov82/da6aedcc6fe8ee33dacc to your computer and use it in GitHub Desktop.
JS Stardate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Stardate script © Phillip L. Sublett | |
// Phillip.L@Sublett.org | |
// http://TrekGuide.com | |
var now = new Date(); | |
var then = new Date("July 15, 1987"); | |
var stardate = now.getTime() - then.getTime(); | |
stardate = stardate / (1000 * 60 * 60 * 24 * 0.036525); | |
stardate = Math.floor(stardate + 410000); | |
stardate = stardate / 10 | |
document.write("Today is Stardate " + stardate); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment