반응형

var date_old_format = "2016-08-10";

var date_new_format = date_old_format.split("/").join("");

-> "20160810"


var date_old_format = "2016-08-10";

var date_new_format = date_old_format.split("/").reverse().join("");

-> "10082016"


출처 : [스텍오버플로우] http://stackoverflow.com/questions/19709793/convert-date-from-dd-mm-yyyy-to-yyyy-mm-dd-in-javascript

반응형

+ Recent posts