Question: In html I have a div with 

```
"dxDateBox:{
          type: 'date',
          value: currentDate}"

```

In the javascript file, I have this observable: 

```
currentDate: ko.observable(new Date())

```

When I insert it into database with

```
 chModel.currentDate()

```

it inserts this: 

```
Wed May 03 2017 11:08:50 GMT+0300 (GTB Daylight Time)

```

instead of this, which is how my date is displayed on the website

```
5/3/2017

```

How do I fix it? 
P.S: I want the date on my website to be the current date.
Thanks!

Answer: 
Try this`

```js
var currentDate = new Date();
document.getElementById("spDate").innerHTML=currentDate.getMonth()+1 + "/" + currentDate.getDate() + "/" + currentDate.getFullYear();
```

```html
<span id="spDate"></span>
```

I added 1 number to month because javascript months are zero-based
```
function myFunction() { 
    var date = new Date();
    var month = d.getMonth();
    var day = d.getDay();
    var year = d.getFullYear();
    document.getElementById("dxDateBox").innerHTML =month + "/" + day + "/" + year;
}

```

This works for me in javascript