-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
79 lines (73 loc) · 1.92 KB
/
index.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
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>localDate.js Demo</title>
<style type="text/css">
body {
font-family: 'Arial', 'Helvetica', sans-serif;
font-size: 10px;
font-weight: normal;
line-height: 1.2;
margin: 2.4em 1.2em;
padding: 0 1.2em;
border: .4em solid #999;
background: #ccc;
color: #333;
}
a {
font-weight: bold;
text-decoration: none;
}
a:link, a:visited {
color: #666;
}
a:hover {
color: #999;
}
a:active {
color: #333;
}
h1 {
border-bottom: .1111em solid #666;
font-size: 3.6em;
line-height: .9em;
margin: .3333em auto .5em 0;
padding: 0 2em 0 .3333em;
float: left;
}
h1+* {
clear: both;
}
p {
font-size: 2.4em;
margin: .5em 0;
padding: 0;
}
span.localDate, span#stopwatch {
font-weight: bold;
}
</style>
</head>
<body>
<h1>localDate.js Demo</h1>
<p>For more details, visit the <a href="https://github.com/KeMBro2012/localDate.js" title="localDate.js GitHub Repository">localDate.js GitHub Repository</a></p>
<p>The current local time is: <span class="localDate" data-source="current">[LOADING...]</span></p>
<p>The current UTC time is: <span class="localDate" data-source="current" data-locale="UTC">[LOADING...]</span></p>
<p>You've been staring at this page for <span id="stopwatch" data-source="0" data-locale="UTC" data-format="$Th $Mm $S.$Zs">[Loading...]</span></p>
<script src="bin/localDate.js" type="text/javascript"></script>
<script type="text/javascript">
// This one handles the current local and UTC times
localDate.init();
// This one handles the millisecond-accurate timer
var el = document.getElementById("stopwatch");
var startTime = new Date().getTime();
localDate.initSingle(el);
setInterval(function() {
var time = (new Date().getTime() - startTime) / 1000;
el.setAttribute("data-source", time);
localDate.render(el);
}, 33);
</script>
</body>
</html>