1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
5 var gStardate, gSDBase;
7 window.onload = function() {
8 setTimeout(updateStardate, 0);
11 function updateStardate() {
13 gStardate = document.getElementById("stardate");
15 var curDate = new Date();
18 gSDBase = new Date("September 8, 1966 20:00:00 EST");
20 var sdateval = (curDate - gSDBase) / (86400 * 365.2425);
21 gStardate.textContent = sdateval.toFixed(1);
23 setTimeout(updateStardate, 5*60*1000);