Question

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);
Était-ce utile?

La solution

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!

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top