I\'m working on a Phonegap-based iOS app, which is already done for Android. The following lines are working fine for Android but not for iOS. Why?
var d = n
I can't tell you why. Maybe because iOS doesn't support the Javascript Date function as well as Android, or support a different format?
But I can give you a workaround:
var s = "2015-12-31 00:00:00".split(" ")[0].split("-"),
d = new Date( s[0], s[1], s[2], 0, 0, 0 );
console.log(d);
var s = "2015-12-31 00:00:00".replace(/[ :]/g, "-").split("-"),
d = new Date( s[0], s[1], s[2], s[3], s[4], s[5] );
console.log(d);