ellisd5
07-03-2003, 12:51 PM
I have a string which is always in this format dd/mm/yyyy
i do the following to retrieve the month :-
var month = parseInt(sDate.substring(3, 5));
however there is a problem with this.
I have alerted the values out of sDate.substring(3, 5) and month when i enter different values :-
sDate.substring(3, 5) | month
------------------------------------------
01 | 1
02 | 2
03 | 3
04 | 4
05 | 5
06 | 6
07 | 7
08 | 0
09 | 0
10 | 10
11 | 11
12 | 12
Why is 08, and 09 being parsed to a 0 ????????
how can I fix this?
Really need to sort this asap so any help would be great.
thanks, Dale
i do the following to retrieve the month :-
var month = parseInt(sDate.substring(3, 5));
however there is a problem with this.
I have alerted the values out of sDate.substring(3, 5) and month when i enter different values :-
sDate.substring(3, 5) | month
------------------------------------------
01 | 1
02 | 2
03 | 3
04 | 4
05 | 5
06 | 6
07 | 7
08 | 0
09 | 0
10 | 10
11 | 11
12 | 12
Why is 08, and 09 being parsed to a 0 ????????
how can I fix this?
Really need to sort this asap so any help would be great.
thanks, Dale