export const getCurrentDate = (format: string, timeStamp: boolean) => {const date = new Date();var year = date.getFullYear() //年var month = date.getMonth() + 1 //月var day = date.getDate() //日var hour = date.getHours() //时var minutes = date.getMinutes() //分var seconds = date.getSeconds() //秒var S = ":"var T = '-'if (format == 'yyyy-mm-dd') {const dateTime = year + T + month + T + dayif(timeStamp) return moment(dateTime).valueOf()return dateTime} else if(format == 'yyyy-mm-dd hh:mm:ss') {const dateTime = year + T + month + T + day + ' ' + hour + S + minutes + S + secondsif(timeStamp) return moment(dateTime).valueOf()return dateTime}}
700字范文,内容丰富有趣,生活中的好帮手!