js去除日期字符串中的时分秒

原文:https://www.cnblogs.com/weirenxing/p/6293840.html

var date = "2015-11-11 00:00:00";

var newDate=/\d{
    
    4}-\d{
    
    1,2}-\d{
    
    1,2}/g.exec(date)

newDate="2015-11-11";

猜你喜欢

转载自blog.csdn.net/weixin_46099269/article/details/112860251