export const formatDate = ( time: any ) => {// 格式化日期yyyy-MM-dd
    const Dates = new Date( time );
    const year: number = Dates.getFullYear();
    const month: any = ( Dates.getMonth() + 1 ) < 10 ? '0' + ( Dates.getMonth() + 1 ) : ( Dates.getMonth() + 1 );
    const day: any = Dates.getDate() < 10 ? '0' + Dates.getDate() : Dates.getDate();
    return year + '-' + month + '-' + day;
  };
export const formatDateTime =(dateTime: any)=> { // 格式化yyyy-MM-dd HH:mm:ss
    const date = new Date(dateTime)
    const y = date.getFullYear()
    let m: string | number = date.getMonth() + 1
    m = m < 10 ? `0${String(m)}` : m
    let d: string | number = date.getDate()
    d = d < 10 ? `0${String(d)}` : d
    let h: string | number = date.getHours()
    h = h < 10 ? `0${String(h)}` : h
    let minute: string | number = date.getMinutes()
    minute = minute < 10 ? `0${String(minute)}` : minute
    let second: string | number = date.getSeconds()
    second = second < 10 ? `0${String(second)}` : second
    return `${String(y)}-${String(m)}-${String(d)}   ${String(h)}:${String(
      minute
    )}:${String(second)}`
  }
