简体   繁体   中英

convert string into datetime by using javascript?

My string is like 3/29/2016 17:30 .How to convert it into datetime in javascript? and I want to compare it with another date?

var date= new Date("2016-03-29 17:30:00".replace(/-/g,"/"));

如果日期是动态的,那么您必须使用substring方法和上述格式的concat打破该日期。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM