日期格式化
function formatTime(targetTime) {
const date = targetTime ? new Date(targetTime) : new Date();
const add0 = str => str > 9 ? str : '0' + str;
return date.getFullYear()
+'/'+ add0(date.getMonth() + 1)
+'/'+ add0(date.getDate())
+' '+ add0(date.getHours())
+':'+ add0(date.getMinutes())
+':'+ add0(date.getSeconds());
}