javascript时间如果只有一位的时候补成两位
js时间格式化工具
const formateTime = date =>{
//获取单个的年月日时分秒
const year = date.getFullYear();
const month = date.getMonth()+1;
const day = date.getDate();
const hour = date.getHours();
const minute = date.getMinutes();
const second = date.getSeconds();
原创
2020-07-16 10:54:40 ·
848 阅读 ·
0 评论