Question: So I'm trying to add a certain number of days to a date, and I'm getting a strange issue:

```
var date = new Date();

var newdate = date.getDate() + $('#ddlDays option:selected').val();

date.setDate(newdate);

```

So if today is 09/29/2010, the Date is 29. But if a user selects "5" from ddlDays, it will assume I am adding strings together, adding 295 days to my date.

I was under the impression that javascript would assume they were integers? Does getDate() return a string instead of an integer?

How can I fix this?

Answer: 
If you just want to add the selected value to the day of the month (i.e. 29 + 5), then you need to parse the string value into an int:

```
var newdate = date.getDate() + parseInt( $('#ddlDays option:selected').val(), 10);

```

But if you actually want a new date, rather than an int, as your result, you can do something like this:

```
date.setDate( date.getDate() + parseInt( $('#ddlDays option:selected').val(), 10);

```
adding days and converting it to a specific format are talked about in this [question](https://stackoverflow.com/questions/3818193/how-to-add-number-of-days-to-todays-date)