Skip to content Skip to sidebar Skip to footer

Invalid Date In Firefox - Javascript

I want to put the following string: '10-10-2013 03:04' in a Date object. It's working in Chrome but Firefox tells me it's an invalid Date. (I guess they mean format?) I tried to us

Solution 1:

<script>
    var myDate = new Date("10 10 2013 03:04");
    console.log(myDate);
</script>

According to the standard, https://www.rfc-editor.org/rfc/rfc2822#page-14, space can be used to separate date, month and year. The above example works perfectly in Chrome and Firefox.


Post a Comment for "Invalid Date In Firefox - Javascript"