阅读背景:

根据时间戳获取年月日时分秒

来源:互联网 
// 根据时间戳获取年月日时分秒
function getYMDHMS(time) {
    var year = time.getFullYear(),
        month = time.getMonth() + 1,
        date = time.getDate(),
        hours = time.getHours(),
        minute = time.getMinutes(),
        second = time.getSeconds();

    if (month < 10) { month = '0' + month; }
    if (date < 10) { date = '0' + date; }
    if (hours < 10) { hours = '0' + hours; }
    if (minute < 10) { minute = '0' + minute; }
    if (second < 10) { second = '0' + second; }

    return {
        year: year,
        month: month,
        date: date,
        hours: hours,
        minute: minute,
        second: second
    }
}
// 根据时间戳获取年月日时分秒
function getYMDHMS(time) {



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: