deshi2003
05-28-2009, 11:01 AM
hey i was working on Date() object of javascript
when i write
today=new Date();
year=today.getYear();
month=today.getMonth();
day=today.getDay();
here everything was correct but when i print month then i got currentmonth-1 that if the currentmonth is 5 then t get 4
if the current month is 07 then i get 06.
at last i worked by adding 1 with month like month+1
is there any one who faced this problem or know about this problem.
please let me know what is the cause behind this
when i write
today=new Date();
year=today.getYear();
month=today.getMonth();
day=today.getDay();
here everything was correct but when i print month then i got currentmonth-1 that if the currentmonth is 5 then t get 4
if the current month is 07 then i get 06.
at last i worked by adding 1 with month like month+1
is there any one who faced this problem or know about this problem.
please let me know what is the cause behind this