Pergunta

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);
Foi útil?

Solução

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!

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top