SOURCE

let abc = moment().format('MMMM Do YYYY, h:mm:ss a');
console.log(abc);
let isBefore = moment('2021-7-8').isBefore('2021-6-6');
console.log(isBefore);



let days = moment('2021-07-08').diff(moment('2021-04-05'), 'days')
console.log(days)


// const date1=moment('2019-02-28 08:30:00');
// const date2=moment('2019-02-28 18:00:00');
// const date3=date2.diff(date1,'minute');//计算相差的分钟数
// console.log(date3)

const date1 = moment('2019-02-28 08:30:00');
const date3 = moment('2019-02-28 18:00:00').diff(moment('2019-02-28 08:30:00'), 'minute');//计算相差的分钟数
console.log(date3)

let aaaaa = moment(new Date()).diff(moment('2022-03-31 09:00:00'), 'minute');
console.log(aaaaa)

let meta = [
    { name: '111', REC_TIME: '2022-01-03' }, 
    { name: '222', REC_TIME: '2022-02-03' }, 
    { name: '333', REC_TIME: '2022-03-03' }
    ];
let recTimeArray = meta.map(t => new Date(t.REC_TIME));
let maxRecTime = moment(new Date(Math.max(...recTimeArray))).format("YYYY-MM-DD HH:mm:ss");
console.log(maxRecTime)
console 命令行工具 X clear

                    
>
console