Merge pull request #108 from lanrenwo/dev

优化gDateFormat函数, 显示完整的时间格式
This commit is contained in:
bjdgyc 2022-06-30 09:35:00 +08:00 committed by GitHub
commit 918859cc62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -5,9 +5,9 @@ function gDateFormat(p) {
var year = da.getFullYear();
var month = da.getMonth() + 1;
var dt = da.getDate();
var h = da.getHours();
var m = da.getMinutes();
var s = da.getSeconds();
var h = ('0'+da.getHours()).slice(-2);
var m = ('0'+da.getMinutes()).slice(-2)
var s = ('0'+da.getSeconds()).slice(-2);
return year + '-' + month + '-' + dt + ' ' + h + ':' + m + ':' + s;
}