I'm trying to format a Date String in React Native.
Ex: 2016-01-04 10:34:23
Following is the code I'm using.
var date = new Date("2016-01-04 10:34:23");
console.log(date);
My problem is, when I'm emulating this on a iPhone 6S, it'll print Mon Jan 04 2016 10:34:23 GMT+0530 (IST) without any problem. But if I try with the iPhone 5S it prints nothing. And if you try to get the month by using a method like date.getMonth() it'll print "NaN".
Why is this? What is the workaround?