current position:Home>The element UI time selector changes the standard time format to custom

The element UI time selector changes the standard time format to custom

2022-01-27 04:35:37 Rolling mill

getDateString(date) {
      let year = date
        .getFullYear()
        .toString()
        .padStart(4, "0");
      let month = (date.getMonth() + 1).toString().padStart(2, "0");
      let day = date
        .getDate()
        .toString()
        .padStart(2, "0");
      let hour = date
        .getHours()
        .toString()
        .padStart(2, "0");
      let minute = date
        .getMinutes()
        .toString()
        .padStart(2, "0");
      let second = date
        .getSeconds()
        .toString()
        .padStart(2, "0");
      return `${year}/${month}/${day}/${hour}:${minute}:${second}`;
    }

The time format is

 

copyright notice
author[Rolling mill],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/01/202201270435337382.html

Random recommended