Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
libai
/
Static
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
b5682e63
authored
Dec 12, 2019
by
dabai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hd
parent
3a146412
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
js/common.js
js/common.js
View file @
b5682e63
...
...
@@ -11,6 +11,23 @@ $.ajaxSetup({
}
})
function
getTime
(
time
){
var
timezone
=
8
;
//目标时区时间,东八区
var
offset_GMT
=
new
Date
(
time
*
1000
).
getTimezoneOffset
();
// 本地时间和格林威治的时间差,单位为分钟
var
nowDate
=
new
Date
(
time
*
1000
).
getTime
();
// 本地时间距 1970 年 1 月 1 日午夜(GMT 时间)之间的毫秒数
var
data
=
new
Date
(
nowDate
+
offset_GMT
*
60
*
1000
+
timezone
*
60
*
60
*
1000
);
var
month
=
data
.
getMonth
()
+
1
;
var
day
=
data
.
getDate
();
var
hour
=
data
.
getHours
();
var
minute
=
data
.
getMinutes
();
var
sec
=
data
.
getSeconds
();
return
add0
(
month
)
+
'-'
+
add0
(
day
)
+
' '
+
add0
(
hour
)
+
':'
+
add0
(
minute
)
+
':'
+
add0
(
sec
);
}
//時間加0
function
add0
(
m
)
{
return
m
<
10
?
'0'
+
m
+
""
:
m
+
""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment