V
V
vegarulez2015-10-13 02:54:05
JavaScript
vegarulez, 2015-10-13 02:54:05

How to make Date.parse work?

Can you tell me why this code works successfully in firefox, but does not work in IE?

<script type="text/javascript" src="./js/jquery-1.4.3.min.js"></script>


function myparsedate(){
var Mydate = '2015-03-13T00:00:00.000+0300';
var q = new Date(Date.parse(Mydate));
var w = q.getDate() + '.' + (q.getMonth() + 1) + '.' + q.getFullYear();
return w;
}


In Firefox, respectively, the result of the function:
13.3.2015

in IE:
NaN.NaN.NaN

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Taratin, 2015-10-13
@vegarulez

momentjs.com

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question