mirror of
https://github.com/tznb1/TwoNav.git
synced 2025-08-10 08:51:49 +00:00
v2.0.11-20230414
This commit is contained in:
@@ -35,13 +35,16 @@ function _GET(letiable,top = false){
|
||||
return false;
|
||||
}
|
||||
//时间戳格式化
|
||||
function timestampToTime(timestamp) {
|
||||
function timestampToTime(timestamp,ymd = false) {
|
||||
let date = new Date(timestamp * 1000);
|
||||
let y = date.getFullYear();
|
||||
let m = date.getMonth() + 1;
|
||||
m = m < 10 ? ('0' + m) : m;
|
||||
let d = date.getDate();
|
||||
d = d < 10 ? ('0' + d) : d;
|
||||
if(ymd){
|
||||
return y + '-' + m + '-' + d;
|
||||
}
|
||||
let h = date.getHours();
|
||||
h = h < 10 ? ('0' + h) : h;
|
||||
let minute = date.getMinutes();
|
||||
|
||||
Reference in New Issue
Block a user