teija
09-12-2003, 05:45 AM
Hi
I did just like you suggested but it doesn't work?
I'm confused - is it really this hard to deal with dates in JS?
I tried to simply get the setDate -function to work, without any form fields to confuse it - but it does not work
this is what I tried:
day1 = new Date("12.9.2003");
day1.setDate(24);
alert(day1);
it gives me NaN! So I think it referres to the date format that I'm jusing! When I put ("July 27, 1962 23:30:00") in there it works - but it only chages the day to be 24 and this is not what I wanted. I wanted the function to add days to given date! I'm beginning to wonder if this is even possible with JS?
t.teija
I did just like you suggested but it doesn't work?
I'm confused - is it really this hard to deal with dates in JS?
I tried to simply get the setDate -function to work, without any form fields to confuse it - but it does not work
this is what I tried:
day1 = new Date("12.9.2003");
day1.setDate(24);
alert(day1);
it gives me NaN! So I think it referres to the date format that I'm jusing! When I put ("July 27, 1962 23:30:00") in there it works - but it only chages the day to be 24 and this is not what I wanted. I wanted the function to add days to given date! I'm beginning to wonder if this is even possible with JS?
t.teija