-
Notifications
You must be signed in to change notification settings - Fork 0
/
decimaltime.html
234 lines (219 loc) · 10.3 KB
/
decimaltime.html
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
<!DOCTYPE html>
<html>
<body>
<span style="font-size: 2.75vw; color: #00FF00;" id="gtext"><span id="weekday"></span>, <span id="demo"></span>/<span id="demo2">/</span>/<span id="demo3"></span> <span id="demo4"></span>:<span id="demo5"></span>:<span id="demo6"></span>:<span id="demo7"></span> </span><span id="btext"><font style="font-size:1vw">Note: Time may vary in accuracy due to dependence on the computer's local clock.</font><br/>
<h1>Format: Weekday, Years/Month/Day Hours:Minutes:Seconds:Milliseconds</h1>
<h2>There are 10 months in a year, 10 days in a month, 10 hours in a day, 100 minutes in an hour, 100 seconds in a minute and 1000 milliseconds in a second.</h2><h3>A day is the approximate amount of time it takes for the Earth to complete a full rotation in respect to the Sun.</h3><br/><br/>Conversions: (WARNING: changing theme may reset any values)<br/>
Imperial seconds to decimal: <input id="inputseci" type="number" oninput="sec2dec(this.value)" onchange="sec2dec(this.value)">
<span id="outputsecd"></span>
<script>
function sec2dec(valNum) {
document.getElementById("outputsecd").innerHTML=Math.round((valNum/0.864)*100)/100;
}
</script><br/>
Decimal seconds to imperial: <input id="inputsecd" type="number" oninput="sec2imp(this.value)" onchange="sec2imp(this.value)">
<span id="outputseci"></span>
<script>
function sec2imp(valNum) {
document.getElementById("outputseci").innerHTML=Math.round((valNum*0.864)*100)/100;
}
</script><br/>
Imperial minutes to decimal: <input id="inputmin" type="number" oninput="min2dec(this.value)" onchange="min2dec(this.value)">
<span id="outputmind"></span>
<script>
function min2dec(valNum) {
document.getElementById("outputmind").innerHTML=Math.round((valNum/1.44)*100)/100;
}
</script><br/>
Decimal minutes to imperial: <input id="inputmind" type="number" oninput="min2imp(this.value)" onchange="min2imp(this.value)">
<span id="outputmini"></span>
<script>
function min2imp(valNum) {
document.getElementById("outputmini").innerHTML=Math.round((valNum*1.44)*100)/100;
}
</script><br/>
Imperial hours to decimal: <input id="inputhoui" type="number" oninput="hou2dec(this.value)" onchange="hou2dec(this.value)">
<span id="outputhoud"></span>
<script>
function hou2dec(valNum) {
document.getElementById("outputhoud").innerHTML=Math.round((valNum/2.4)*100)/100;
}
</script><br/>
Decimal hours to imperial: <input id="inputhoud" type="number" oninput="hou2imp(this.value)" onchange="hou2imp(this.value)">
<span id="outputhoui"></span>
<script>
function hou2imp(valNum) {
document.getElementById("outputhoui").innerHTML=Math.round((valNum*2.4)*100)/100;
}
</script><br/>
1 decimal day = 1 Earth day. Do you really need a converter for that?</br>
Earth years to decimal: <input id="inputyeai" type="number" oninput="yea2dec(this.value)" onchange="yea2dec(this.value)">
<span id="outputyead"></span>
<script>
function yea2dec(valNum) {
document.getElementById("outputyead").innerHTML=Math.round((valNum*3.652425)*100)/100;
}
</script><br/>
Decimal years to Earth: <input id="inputyead" type="number" oninput="yea2imp(this.value)" onchange="yea2imp(this.value)">
<span id="outputyeai"></span>
<script>
function yea2imp(valNum) {
document.getElementById("outputyeai").innerHTML=Math.round((valNum/3.652425)*100)/100;
}
</script><br/><br/>
<a href="javascript:showqa()" id="askq">Show questions and answers</a>
<br/><br/><br/><span id="qa" style="display: none;">Why aren't years based on actual Earth years?
</br></br>
<blockquote>I tried playing with this a bit, and people did not like the results as it meant the system was not fully decimal. I deemed days to be of greater importance.</blockquote>
</br>
Why do the units share the same name as imperial units?
</br></br>
<blockquote>Look at the day names. I'm not that inventive.</blockquote>
</br>
Why are there no month names?
</br></br>
<blockquote>Again, I'm not that inventive.</blockquote>
</br>
How many weeks are in a month?
</br></br>
<blockquote>1. They're the same.</blockquote>
</br>
Why is there no converter for weeks/months?
</br></br>
<blockquote>People don't tend to measure time by measure of imperial weeks, and imperial months change so much and the change is based on literally nothing.</blockquote>
</br>
What are the weekday names?
</br></br>
<blockquote>0 - Startday, 1 - 0yday, 2 - Hugday, 3 - Freeday, 4 - Sansday, 5 - Anarchyday, 6 - Atheismday, 7 - Memesday, 8 - Happyday, 9 - Loveday.</blockquote>
</br>
Why is it not just a number of days?
</br></br>
<blockquote>This just would not be practical, because it would be very hard to read and it'd be harder to say verbally in an informal manner.</blockquote>
</br>
Are there different timezones?
</br></br>
<blockquote>No. 0:00:00:000 (decimal midnight) is the same as UTC midnight.</blockquote>
</br>
Can I copy the system/code/anything from this page?
</br></br>
<blockquote>Yes! You can use everything here without restriction. I don't know why you'd want the code though, it is a complete mess. If you could sync this with an atomic clock though, that's be amazing. If you want to create decent names for things or modify anything please do so.</blockquote>
</br>
Do you still love me when it's not Loveday and will you hug me when it's not Hugday?
</br></br>
<blockquote>Of course, I love you infinitely all days and I'll hug you any time, my friend.</blockquote>
<br/>Still got questions? Email me at <a href="mailto:[email protected]">[email protected]</a> and I'll answer as soon as I can. If you prefer, you can message me through <a href="https://www.youtube.com/brmbrmcar/about">https://www.youtube.com/brmbrmcar/about</a> which will probably result in a very slow response or you can message through Discord (probably the quickest method) by joining, if you want to talk in direct messages my id is but the guild (server) is also fine to ask in.</span>
</span><br/><br/><span id="hidecookie"><a id="switch" href="javascript:dark()">Go dark</a> <a href="javascript:rememberdark()">Always use dark theme (extremely small cookie)</a> </span><a id="delete" style="visibility:hidden" href="javascript:eraseCookie()">Delete dark theme cookie</a>
<script>
function pad(n, width, z) {
z = z || '0';
n = n + '';
return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
}
function updateClock() {
date = new Date()
ms = date.getMilliseconds()
seconds = (Date.parse(Date())/1000) - 1489276800
document.getElementById("demo").innerHTML = pad(Math.floor(seconds / 8640000),4)
year = Math.floor(seconds / 8640000)*8640000
document.getElementById("demo2").innerHTML = Math.floor((seconds - year) / 864000)
month = Math.floor((seconds - year) / 864000)*864000
document.getElementById("demo3").innerHTML = Math.floor((seconds - year - month) / 86400)
day = Math.floor((seconds - year - month) / 86400)*86400
document.getElementById("demo4").innerHTML = Math.floor((seconds - year - month - day) / 8640)
hour = Math.floor((seconds - year - month - day) / 8640)*8640
document.getElementById("demo5").innerHTML = pad(Math.floor((seconds - year - month - day - hour) / 86.4),2)
minute = Math.floor((seconds - year - month - day - hour) / 86.4)*86.4
document.getElementById("demo6").innerHTML = pad(Math.floor(Math.floor(Math.floor((Date.now()-1489276800)/0.864)-(Math.floor((Date.now()-1489276800)/100000/0.864)*100000))/1000),2)
second = Math.floor(Math.floor(Math.floor((Date.now()-1489276800)/0.864)-(Math.floor((Date.now()-1489276800)/100000/0.864)*100000))/1000)
document.getElementById("demo7").innerHTML = pad(Math.abs(second*1000-Math.floor(Math.floor(Math.floor((Date.now()-1489276800)/0.864)-(Math.floor((Date.now()-1489276800)/100000/0.864)*100000)))),3)
weekdayc = Math.floor((seconds) / 86400)
if (weekdayc.toString().slice(-1) == 0){
document.getElementById("weekday").innerHTML = "Startday"
}
if (weekdayc.toString().slice(-1) == 1){
document.getElementById("weekday").innerHTML = "0yday"
}
if (weekdayc.toString().slice(-1) == 2){
document.getElementById("weekday").innerHTML = "Hugday"
}
if (weekdayc.toString().slice(-1) == 3){
document.getElementById("weekday").innerHTML = "Freeday"
}
if (weekdayc.toString().slice(-1) == 4){
document.getElementById("weekday").innerHTML = "Sansday"
}
if (weekdayc.toString().slice(-1) == 5){
document.getElementById("weekday").innerHTML = "Anarchyday"
}
if (weekdayc.toString().slice(-1) == 6){
document.getElementById("weekday").innerHTML = "Atheismday"
}
if (weekdayc.toString().slice(-1) == 7){
document.getElementById("weekday").innerHTML = "Memesday"
}
if (weekdayc.toString().slice(-1) == 8){
document.getElementById("weekday").innerHTML = "Happyday"
}
if (weekdayc.toString().slice(-1) == 9){
document.getElementById("weekday").innerHTML = "Loveday"
}
}
window.setInterval("updateClock()", 1);
function darktheme()
{
document.body.style.backgroundColor = "black";
document.getElementById("gtext").style.color = "cyan";
document.getElementById("btext").style.color = "purple";
document.getElementById("btext2").style.color = "purple";
}
function dark()
{
darktheme()
document.getElementById("switch").href = "javascript:location.reload()"
document.getElementById("switch").innerHTML = "Go light"
document.getElementById("switch").style.color = "white"
}
function setCookie(cname,cvalue,exdays) {
var d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
var expires = "expires=" + d.toGMTString();
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}
function getCookie(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for(var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
function eraseCookie() {
setCookie('dark1','true1',-1);
location.reload()
}
function rememberdark(){
setCookie('dark1','true1',999);
location.reload()
}
var user = getCookie("dark1");
if (user != "") {
window.open("javascript:dark()","_self")
document.getElementById("hidecookie").innerHTML = ""
document.getElementById("delete").style.visibility = "visible"
}
function showqa()
{
document.getElementById("qa").style.display = "initial"
document.getElementById("askq").innerHTML = ""
}
</script>
<br/><br/><span id="btext2"><font size ="1">Let it be k-nown that I was not fully responsible for the creation of these names.</font></span>
</body>
</html>