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