I have a date in this format: dd.mm.yyyy
When I instantiate a JavaScript date with it, it gives me a NaN
NaN
In c# I can specify a date format, to s
It's easy enough to split the string into an array and pass the parts directly to the Date object:
var str = "01.01.2010"; var dmy = str.split("."); var d = new Date(dmy[2], dmy[1] - 1, dmy[0]);