-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtimeset.html
56 lines (34 loc) · 1.15 KB
/
timeset.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
<!DOCTYPE html>
<html>
<head>
<title>setup Time on Allsky</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body style="background-color:black;">
<p style="color:white">Refresh this page to get the current date and time and press Submit to set the time.</P>
<form action="varpass.php" method="get" Name="newTime">
<input type="text" name="newTime" id= "newTime"/>
<input type="Submit" value="Submit">
<script type="text/javascript">
var date = new Date();
var dd = String(date. getDate()). padStart(2, '0');
var mm = String(date. getMonth() + 1). padStart(2, '0'); //January is 0!
var yyyy = date. getFullYear();
date = yyyy + '-' + mm + '-' + dd;
//document. write(date);
function addZero(i) {
if (i < 10) {i = "0" + i}
return i;
}
const d = new Date();
let h = addZero(d.getHours());
let m = addZero(d.getMinutes());
let s = addZero(d.getSeconds());
let ms = '00';
let time = h + ":" + m + ":" + s ;
var Timechange = date + " " + time;
document.getElementById('newTime').value = Timechange;
</script>
</body>
</html>