# BUG: Date picker format does not match Dashboard -\> Site -\> Date format

**URL:** <https://discourse.nodered.org/t/bug-date-picker-format-does-not-match-dashboard-site-date-format/12409>\
**Category:** General\
**Created:** [20 June 2019 00:34 UTC](https://discourse.nodered.org/t/bug-date-picker-format-does-not-match-dashboard-site-date-format/12409 "2019-06-20T00:34:50Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [20 June 2019 00:34 UTC](https://discourse.nodered.org/t/bug-date-picker-format-does-not-match-dashboard-site-date-format/12409/1 "2019-06-20T00:34:50Z")

</div>

Node-RED version: v0.20.5  
Node.js version: v10.15.3  
Dashboard version 2.15.4

The ui\_date\_picker node says

> The date display can be formatted in the Dashboard - Site tab using [moment.js](https://momentjs.com/docs/#/displaying/) formatting. For example `MM/DD/YYYY` , `Do MMM YYYY` or `YYYY-MM-DD` .

However it alway comes up in the form `9 Jun 2019` no matter what I put in Dashboard -\> Site -\> Date Format

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [21 June 2019 17:39 UTC](https://discourse.nodered.org/t/bug-date-picker-format-does-not-match-dashboard-site-date-format/12409/2 "2019-06-21T17:39:00Z")

</div>

> [@zenofmud](#):
>
> ui\_date\_picker

Yes, you appear to be correct - a bug?

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [21 June 2019 21:58 UTC](https://discourse.nodered.org/t/bug-date-picker-format-does-not-match-dashboard-site-date-format/12409/3 "2019-06-21T21:58:53Z")

</div>

I was hoping someone would agree 😀 I notified Dave and will change the title and add 'BUG'

---

<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:** [21 June 2019 22:31 UTC](https://discourse.nodered.org/t/bug-date-picker-format-does-not-match-dashboard-site-date-format/12409/4 "2019-06-21T22:31:36Z")

</div>

Closed by fix in latest master on github.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [22 June 2019 00:36 UTC](https://discourse.nodered.org/t/bug-date-picker-format-does-not-match-dashboard-site-date-format/12409/5 "2019-06-22T00:36:29Z")

</div>

That was fast 😀

---

<div class="post-metadata">

**Author:** ![hajueG](https://avatars.discourse-cdn.com/v4/letter/h/e68b1a/32.png) [@hajueG](https://discourse.nodered.org/u/hajueG)\
**Post date:** [4 September 2023 08:46 UTC](https://discourse.nodered.org/t/bug-date-picker-format-does-not-match-dashboard-site-date-format/12409/6 "2023-09-04T08:46:42Z")

</div>

In have the follow String:  
{"Nr":4,"Inhalt":"Fish","Menge":"500","Fach":7,"Ablauf":"2023-12-30T23:00:00.000Z"}  
I want to change the format to  
"2023-12-30"  
The entry in format Date:  
moment().format('YYYY-MM-DD');  
has no effect. What is wrong? My mariaDB does not accept the apprndix "T23:00:00.000Z"  
best regards  
HaJueG

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [4 September 2023 09:43 UTC](https://discourse.nodered.org/t/bug-date-picker-format-does-not-match-dashboard-site-date-format/12409/7 "2023-09-04T09:43:44Z")

</div>

@hajueG Welcome to the forum!

Seeing that this thread is four years old, I'm going to close this thread and ask you to open a new thread.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [4 September 2023 09:43 UTC](https://discourse.nodered.org/t/bug-date-picker-format-does-not-match-dashboard-site-date-format/12409/8 "2023-09-04T09:43:45Z")

</div>

Your question does not appear to be related to the thread you have posted, so you would have been better to start a new thread. However one possibility is shown below. If you have further questions please start a new thread.

In a function node you can use substring to extract the first 10 characters of the datetime string. Assuming the data you show is in msg.payload then you do  
`msg.payload.Ablauf = msg.payload.Ablauf.substring(0,10)`

Example

```auto
[{"id":"9105fd5fb3a348c3","type":"inject","z":"bdd7be38.d3b55","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"Nr\":4,\"Inhalt\":\"Fish\",\"Menge\":\"500\",\"Fach\":7,\"Ablauf\":\"2023-12-30T23:00:00.000Z\"}","payloadType":"json","x":360,"y":2000,"wires":[["95693fda06b53eff"]]},{"id":"95693fda06b53eff","type":"function","z":"bdd7be38.d3b55","name":"function 3","func":"msg.payload.Ablauf = msg.payload.Ablauf.substring(0,10)\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":510,"y":2000,"wires":[["f226f8db207e1cc4"]]},{"id":"f226f8db207e1cc4","type":"debug","z":"bdd7be38.d3b55","name":"debug 100","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":710,"y":2000,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [4 September 2023 10:03 UTC](https://discourse.nodered.org/t/bug-date-picker-format-does-not-match-dashboard-site-date-format/12409/9 "2023-09-04T10:03:08Z")

</div>


