In Javascript, the following date is coming up invalid for Firefox. It is valid Chrome. I really want to keep the format because of the 3 digit month and timezone inclusion. How can i get this to be valid in Firefox?

var d = new Date("16-Jan-2014 10:56:24 am PST");
console.log(d);
有帮助吗?

解决方案

Try this,

var d = new Date("16 Jan 2014 10:56:24 am PST");
console.log(d);

Tested and varified in 1) IE 2) Chrome 3) Firefox

fiddle

enter image description here

good luck!

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top