Method: () functions acquired by the date toLocaleString. new Date () toLocaleString ();. // "2019/9/1 11:20:23 AM"
. Method acquisition date: new Date () toLocaleString () .replace (/ \ // g, '-') split ( "") [0]; // "2019-9-1"
toLocaleString () method to convert the local time according to the Date object as a string, and returns the result.