introduction
Graduation thesis is really torture. When was this article written? The file was created on 2023.11.30 and modified on 2022.09.18. I don’t understand it, but I am shocked.
Code
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
| <script>
function secondToDate(second) {
if (!second) {
return 0;
}
var time = new Array(0, 0, 0, 0, 0);
if (second >= 365 * 24 * 3600) {
time[0] = parseInt(second / (365 * 24 * 3600));
second %= 365 * 24 * 3600;
}
if (second >= 24 * 3600) {
time[1] = parseInt(second / (24 * 3600));
second %= 24 * 3600;
}
if (second >= 3600) {
time[2] = parseInt(second / 3600);
second %= 3600;
}
if (second >= 60) {
time[3] = parseInt(second / 60);
second %= 60;
}
if (second > 0) {
time[4] = second;
}
return time;
}</script>
<script type="text/javascript" language="javascript">
function setTime() {
var create_time = Math.round(new Date(Date.UTC(2021, 11, 06, 14, 15, 19)).getTime() / 1000);
var timestamp = Math.round((new Date().getTime() + 8 * 60 * 60 * 1000) / 1000);
currentTime = secondToDate((timestamp - create_time));
currentTimeHtml = 'This Blog has running: <br/>' + currentTime[0] + ' y ' + currentTime[1] + ' d '
+ currentTime[2] + ' h ' + currentTime[3] + ' m ' + currentTime[4]
+ ' s';
document.getElementById("htmer_time").innerHTML = currentTimeHtml;
} setInterval(setTime, 1000);
</script>
|
quote
Add it where you want
1
| <span id="htmer_time" style="color: pink;" />
|
References
个人博客添加运行时间 - 腾讯云开发者社区-腾讯云