-
方案一:
-
var date = "2018-10-08 00:00:00";
-
-
var newDate=/\d{4}-\d{1,2}-\d{1,2}/g.exec(date)
-
-
newDate="2018-10-08";
-
-
方案二:
-
var time_str= '2014-9-19 13:19:21';
-
var t = time_str.substr(0,10);