qingyiay
2023-03-22 8e095c1fd6164fafc7d5cfd144528a0d67afef7c
utils/util.js
@@ -1,7 +1,16 @@
export function todayDate(){
export function todayDate(arg){
   let date = new Date()
   let year = date.getFullYear()
   let month = date.getMonth() + 1;
   let day = date.getDate()
   return year + '-' + month + '-' + day
   let hour = date.getHours()
   let minutes = date.getMinutes()
   let seconds = date.getSeconds()
   console.log(arg,'时间');
   if(arg == 'hms'){
      hour = hour < 10 ? '0' + hour : hour
      minutes = minutes < 10 ? '0' + minutes : minutes
      seconds = seconds < 10 ? '0' + seconds : seconds
      return hour+':'+minutes+':' + seconds
   }
}