Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: 使用 JavaScript 将日期添加到 DateTime
如果今天的日期是 5-12-2012,我想显示第二天的日期 6-12-2012。那是如何用javascript编码的?
var date = "5-12-2012"; var datum = new Date(date); datum.setDate(datum.getDate() + 1); date = datum.getDate() + "-" + (datum.getMonth() + 1) + "-" + datum.getFullYear();