我试图将日期字符串转换为日期格式,如下所示:
var date = "07/11/2015"; //format is mm/dd/yyyy
现在我希望它采用这种格式:
date = Tue Sep 01 2015 00:00:00 GMT+0530 (India Standard Time)
任何人都可以建议一种方法来实现它。提前谢谢!
答案 0 :(得分:3)
var date = "07/11/2015";
alert(new Date(date)); //Sat Jul 11 2015 00:00:00 GMT+0530 (India Standard Time)