• 2024-10-22时间格式化-正则表达式
    //封装工具函数:格式化时间functionformatTime(timestamp,fmtString){//1.将时间戳转成dateconstdate=newDate(timestamp)////获取具体时间////获取年//constyear=date.getFullYear()////获取月份