JS 日期取年月日

var a= /d{4}-d{1,2}-d{1,2}/g.exec('2012-01-02 10:33')[0]
//"2012-01-02"
原文地址:https://www.cnblogs.com/lbonet/p/15045179.html