-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathlunartime.html
More file actions
168 lines (130 loc) Β· 5 KB
/
lunartime.html
File metadata and controls
168 lines (130 loc) Β· 5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<!DOCTYPE html>
<head>
<meta name="viewport" content="width=device-width,minimum-scale=1" />
<title>Lunar Time</title>
<style>
body {
font-family: arial;
background: #32302f;
color: #f4ed18;
display: flex;
flex-direction: column;
}
#earth, #lunar, #atomic-lunar {
font-size: 50px;
}
</style>
</head>
<body>
<div id="earth">
<span class="emoji">π</span>
<span class="time">0:00:00</span>
</div>
<p>
Yesterday I saw <a href="https://www.nature.com/articles/d41586-023-00185-z">an article</a> about the need for having a standard for time-keeping on the moon if there's going to be new moon missions.
</p>
<p>
The length of a second doesn't change, but because the moon has less gravity relativity
apparently tells us that time moves a bit faster <em>relative</em> to earth.
</p>
<p>
I was curious if neil armstrong dropped an atomic clock on the moon, how far ahead it would be right now. Turns out it's less than a second!
</p>
<div id="atomic-lunar">
<span class="emoji">π</span>
<span class="time">0:00:00</span>
</div>
<p>A very small difference, and less than the accuracy of pretty much any watch so while computers will care, a human checking their watch or making plans with another human will not.</p>
<p>
This made me wonder if we can come up with what a fictional calendar might
look like for future Moon denizens.
</p>
<p>
The moon is tidally locked, and takes 29.5306 earth days to go around the earth.
This means that a 'moon day' is also 29.5306 days. So it's similar to Earth day
in that it takes that long for the Sun to be in the sameish spot, but also
similar to the earth year because it takes that long to do 1 full revolution
around it's 'parent'.
</p>
<p>
So I decided to make the 'Lunar Day' the significant number, but what should
the first day be? It makes sense to start counting from a moment significant
to moon people, and what could be more significant than the moon landing?
So our 'epoch' will be July 20th, 1969 at 20:17 UTC when the eagle touched
down.
</p>
<p>
Earth years start counting at 1. Even more akward, there is no year 0. Before
year 1 there's 1 BCE. The first people moving to the moon will likely be
scientist, so that's a mistake the wouldn't make. The lunar calendar starts
at 0, and I'm calling this the Lunar year:
</p>
<div id="lunar">
<span class="emoji">π</span>
<span class="time">0:00:00</span>
</div>
<div>
Looking at this number made me realize something though. While we can
quickly see the Lunar day/year, Humans still live on a 24 hour circadian
cycle, and it's helpful to quickly see how far we're in that cycle. So
instead of a perfect number, it does make sense to me next digit to
represent how many circadian cycles have passed since the lunar year
started.
</div>
<div>
</body>
<script>
// Length of a lunar day, expressed in earth days
//
// Source: https://svs.gsfc.nasa.gov/12739
const moonDayLength = 29.5306;
// Time dilation on the moon compared to earth.
//
// Every 24 earth days the moon adds 5.6 microseconds. This formula
// normalizes this to s/s.
//
// Source: https://www.nature.com/articles/d41586-023-00185-z
const moonTimeDilation = (56e-6) / 86400;
// We consider the '0' of the lunar time the moment the eagle
// landed.
const moonEpoch = new Date('1969-07-20 20:17:00Z');
let interval;
function start() {
interval = setInterval(tick, 10);
}
function tick() {
const date = new Date();
showEarthDate(date);
showLunarDate(date);
showLunarAtomic(date);
}
function showEarthDate(date) {
let emoji;
switch((Math.floor(date.getTime()/10000)) % 3) {
case 1 : emoji = 'π'; break;
case 2 : emoji = 'π'; break;
default: emoji = 'π'; break;
}
document.querySelector('#earth .emoji').innerText = emoji;
document.querySelector('#earth .time').innerText = date.toUTCString();
}
function showLunarDate(date) {
// How many earth ms have passed since the epoch.
const earthTimestamp = date.getTime() - moonEpoch.getTime();
const moonDate = (earthTimestamp / (moonDayLength*86400000)).toFixed(7);
document.querySelector('#lunar .time').innerText = 'Lunar Date: ' + moonDate;
}
function showLunarAtomic(date) {
// How many earth seconds have passed since the epoch.
const earthTimestamp = (date.getTime() - moonEpoch.getTime()) / 1000;
// Account for general relativity.
const moonTimestamp = Math.floor(
earthTimestamp +
(earthTimestamp * moonTimeDilation)
);
//console.log('e: %i, m: %i, d: %i', earthTimestamp, moonTimestamp, earthTimestamp-moonTimestamp);
const moonDateTime = new Date((moonTimestamp*1000)+moonEpoch.getTime());
document.querySelector('#atomic-lunar .time').innerText = moonDateTime.toUTCString();
}
document.addEventListener('DOMContentLoaded', () => start());
</script>