# Mustache date format

**URL:** <https://discourse.nodered.org/t/mustache-date-format/15034>\
**Category:** General\
**Created:** [2 September 2019 16:54 UTC](https://discourse.nodered.org/t/mustache-date-format/15034 "2019-09-02T16:54:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tom\_pi](https://avatars.discourse-cdn.com/v4/letter/t/cab0a1/32.png) [@Tom\_pi](https://discourse.nodered.org/u/Tom_pi)\
**Post date:** [2 September 2019 16:54 UTC](https://discourse.nodered.org/t/mustache-date-format/15034/1 "2019-09-02T16:54:40Z")

</div>

Hello together,  
I have the following issue.  
I have stored several values in a database with a time stamp.  
The time stamp has the following format  
`Timestamp: "2019-08-26T00:00:00.000Z"`  
With the following mustache, I would now like to access the value  
`{{payload.0.payload.Timestamp}}`  
I get returned within the html  
`Mon Aug 26 2019 00:00:00 GMT+0000 (Coordinated Universal Time)`  
But I use the values in a diagram, I need the following format  
`YYYY-MM-DD`  
I have already tried a lot but unfortunately without success  
`{{payload.0.payload.Timestamp | date:"yyyy-MM-dd"}}`  
for example doesnt´show anything.  
Hope someone can help me

Thanks

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [2 September 2019 17:48 UTC](https://discourse.nodered.org/t/mustache-date-format/15034/2 "2019-09-02T17:48:51Z")

</div>

Install the moment node, that can do the conversion easily.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [2 September 2019 18:15 UTC](https://discourse.nodered.org/t/mustache-date-format/15034/3 "2019-09-02T18:15:47Z")

</div>

I presume this is actually about the dashboard  
the form `{{payload.0.payload.Timestamp | date:"yyyy-MM-dd"}}` is a mix of two styles  
either you can use `{{value | date:"yyyy-MM-dd"}}` which is using an angular filter (not mustache) and feed in the date on the msg.payload - or you can use `{{payload.0.payload.Timestamp}}` and format that up yourself in advance. (possibly using the moment node as mentioned)
