# Input type date format "dd-MM-yyyy"

**URL:** https://discourse.nodered.org/t/input-type-date-format-dd-mm-yyyy/5679
**Category:** General
**Created:** [11 December 2018 15:01 UTC](https://discourse.nodered.org/t/input-type-date-format-dd-mm-yyyy/5679 "2018-12-11T15:01:07Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![hathemi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hathemi/32/3792_2.png) [@hathemi](https://discourse.nodered.org/u/hathemi)
#### Post date: [11 December 2018 15:01 UTC](https://discourse.nodered.org/t/input-type-date-format-dd-mm-yyyy/5679/1 "2018-12-11T15:01:07Z")

</div>

I have an input type date

`> <input type="date" ng-model="msg.payload.data1" id="date" name="Date" >`

when i dispaly it in template mustache node, i get like this  
 ![date](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/0/04ed59fae68c1bc6182b86621bae24ffc59d858e.png)

i want to change the format of date. i have tried this code below but it doesn't work. it dispalays nothing.  
{{payload.0.data1|date:'mediumDate'}

---

<div class="post-metadata">

### Author: ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)
#### Post date: [11 December 2018 15:21 UTC](https://discourse.nodered.org/t/input-type-date-format-dd-mm-yyyy/5679/2 "2018-12-11T15:21:48Z")

</div>

Can't you reformat it in a function node or use the contrib-moment node?

---

<div class="post-metadata">

### Author: ![hathemi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hathemi/32/3792_2.png) [@hathemi](https://discourse.nodered.org/u/hathemi)
#### Post date: [11 December 2018 15:40 UTC](https://discourse.nodered.org/t/input-type-date-format-dd-mm-yyyy/5679/3 "2018-12-11T15:40:59Z")

</div>

> [@ukmoose](#):
>
> contrib-moment node

Sorry I did not know about the existence of that node. Thanks

---

<div class="post-metadata">

### Author: ![Marooned](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marooned/32/2858_2.png) [@Marooned](https://discourse.nodered.org/u/Marooned)
#### Post date: [12 December 2018 10:07 UTC](https://discourse.nodered.org/t/input-type-date-format-dd-mm-yyyy/5679/4 "2018-12-12T10:07:23Z")

</div>

> [@hathemi](#):
>
> i have tried this code below but it doesn't work. it dispalays nothing.  
> {{payload.0.data1|date:'mediumDate'}

```auto
<input type="date" ng-model="msg.payload.data1" id="date" name="Date" >
{{msg.payload.data1 | date:'mediumDate'}}

```

This code works for me as expected. You refered that by `payload.0.data1` but there is no array in your example.
