网站首页
编程语言
数据库
系统相关
其他分享
编程问答
fmtString
2024-10-22
时间格式化-正则表达式
//封装工具函数:格式化时间functionformatTime(timestamp,fmtString){//1.将时间戳转成dateconstdate=newDate(timestamp)////获取具体时间////获取年//constyear=date.getFullYear()////获取月份