Skip to content

Commit

Permalink
feat✨: 展示文章最后更新时间
Browse files Browse the repository at this point in the history
  • Loading branch information
simply-none committed Feb 17, 2023
1 parent 1e4a56d commit f4c192c
Show file tree
Hide file tree
Showing 5 changed files with 479 additions and 345 deletions.
15 changes: 15 additions & 0 deletions date.format.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
formatTimestamp(time) {
var date = new Date(time);

var year = date.getFullYear(),
month = date.getMonth() + 1, //月份是从0开始的
day = date.getDate(),
hour = date.getHours(),
min = date.getMinutes(),
sec = date.getSeconds();
var newTime =
year + '-' + month + '-' + day + ' ' + hour + ':' + min + ':' + sec;
return newTime;
},
};
Loading

0 comments on commit f4c192c

Please sign in to comment.