# Node-Red: Dashboard Form

**URL:** https://discourse.nodered.org/t/node-red-dashboard-form/88536
**Category:** Dashboard
**Tags:** node-red-dashboard
**Created:** [6 June 2024 13:00 UTC](https://discourse.nodered.org/t/node-red-dashboard-form/88536 "2024-06-06T13:00:56Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![AK\_Cofig](https://avatars.discourse-cdn.com/v4/letter/a/ba9def/32.png) [@AK\_Cofig](https://discourse.nodered.org/u/AK_Cofig)
#### Post date: [6 June 2024 13:00 UTC](https://discourse.nodered.org/t/node-red-dashboard-form/88536/1 "2024-06-06T13:00:56Z")

</div>

Hello All,

I am working with Node-red V3.0.2 and Node.js V16.20.0, installed in a Raspberry Pi 4  
In part of a project, I use " **Node-Red: Dashboard Form**" to collect multiple values from the user on the submit button.  
I have added a Date type input in this form to select the actual date from the dropdown menu and show it on the output.  
However, the date that is generated in the output does not match the local time zone that I have set on my Raspberry Pi.  
I would appreciate it if someone could share their experience with me to fix this error.

Thank you.

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [6 June 2024 13:27 UTC](https://discourse.nodered.org/t/node-red-dashboard-form/88536/2 "2024-06-06T13:27:38Z")

</div>

I suggest the first thing to do is upgrade Node-red and especially node.js

Use the command from the documentation and put --node20 at the end outside the brackets.

Check via manage palette for updates to node-red-dashboard too.

It might not affect ui-form but will resolve lots of issues with out of date node.js.

---

<div class="post-metadata">

### Author: ![AK\_Cofig](https://avatars.discourse-cdn.com/v4/letter/a/ba9def/32.png) [@AK\_Cofig](https://discourse.nodered.org/u/AK_Cofig)
#### Post date: [7 June 2024 16:21 UTC](https://discourse.nodered.org/t/node-red-dashboard-form/88536/3 "2024-06-07T16:21:32Z")

</div>

Thanks for your reply,  
I have updated everything you suggested. However, the Date and Time coming from Form Node still do not match my local time zone.  
**Node-Red: Dashboard Form** output --\> 2 **024-06-06T22:00:00.000Z** while I am in 06/07/2024 on my Raspberry Pi.

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [7 June 2024 16:31 UTC](https://discourse.nodered.org/t/node-red-dashboard-form/88536/4 "2024-06-07T16:31:29Z")

</div>

What timezone are you in?

Can you share the relevant part of your flow and tell us what you enter into the form?

Also the timezone setting on the Pi (date and locale commands)

If you are viewing the dashboard from another computer, the timezone settings there too.

---

<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: [7 June 2024 17:24 UTC](https://discourse.nodered.org/t/node-red-dashboard-form/88536/5 "2024-06-07T17:24:52Z")

</div>

What date/time in your time zone is 22:00 UTC on 6th?

---

<div class="post-metadata">

### Author: ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)
#### Post date: [7 June 2024 19:06 UTC](https://discourse.nodered.org/t/node-red-dashboard-form/88536/6 "2024-06-07T19:06:14Z")

</div>

What do you get if you enter the command ` timedatectl` in your cmd prompt?  
It should return amongst other things your **Local Time** and also the **Timezone** which your system is using. Are they both correct?

---

<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: [7 June 2024 21:24 UTC](https://discourse.nodered.org/t/node-red-dashboard-form/88536/7 "2024-06-07T21:24:24Z")

</div>

In what format do you want the date?

---

<div class="post-metadata">

### Author: ![AK\_Cofig](https://avatars.discourse-cdn.com/v4/letter/a/ba9def/32.png) [@AK\_Cofig](https://discourse.nodered.org/u/AK_Cofig)
#### Post date: [7 June 2024 21:25 UTC](https://discourse.nodered.org/t/node-red-dashboard-form/88536/8 "2024-06-07T21:25:21Z")

</div>

I've set Europe and Paris time zones in the Raspberry Pi ([Tutorial](https://support.optisigns.com/hc/en-us/articles/360056655633-How-to-Change-Time-Zone-on-Your-Raspberry-Pi-device)). Similarly, I select "UTC+01:00 Paris" on my PC, where I check the Node-red dashboard.  
here you have a JSON for this test.

```auto
[
    {
        "id": "0aa81f27b03a5529",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "383541189db48432",
        "type": "ui_form",
        "z": "0aa81f27b03a5529",
        "name": "",
        "label": "",
        "group": "8f1d10f48f93aac5",
        "order": 2,
        "width": 0,
        "height": 0,
        "options": [
            {
                "label": "Date",
                "value": "Date ",
                "type": "date",
                "required": true,
                "rows": null
            }
        ],
        "formValue": {
            "Date ": ""
        },
        "payload": "",
        "submit": "Submit",
        "cancel": "Cancel",
        "topic": "payload",
        "topicType": "str",
        "splitLayout": true,
        "className": "",
        "x": 430,
        "y": 280,
        "wires": [
            [
                "37414371a9b9a5cb"
            ]
        ]
    },
    {
        "id": "37414371a9b9a5cb",
        "type": "debug",
        "z": "0aa81f27b03a5529",
        "name": "debug 19",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 640,
        "y": 280,
        "wires": []
    },
    {
        "id": "8f1d10f48f93aac5",
        "type": "ui_group",
        "name": "Default",
        "tab": "f6e26b53496f9dcb",
        "order": 5,
        "disp": true,
        "width": "6",
        "collapse": false,
        "className": ""
    },
    {
        "id": "f6e26b53496f9dcb",
        "type": "ui_tab",
        "name": "Checkist ",
        "icon": "dashboard",
        "order": 1,
        "disabled": false,
        "hidden": false
    }
]

```

---

<div class="post-metadata">

### Author: ![AK\_Cofig](https://avatars.discourse-cdn.com/v4/letter/a/ba9def/32.png) [@AK\_Cofig](https://discourse.nodered.org/u/AK_Cofig)
#### Post date: [7 June 2024 21:32 UTC](https://discourse.nodered.org/t/node-red-dashboard-form/88536/9 "2024-06-07T21:32:12Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/c/9c62adcabd5f3afa5fd365f39acac30a7650afd4.png)

The timezone and local time are the same as my PC where I see the dashboard.  
This is what I am looking for by Form Node. 😐

---

<div class="post-metadata">

### Author: ![AK\_Cofig](https://avatars.discourse-cdn.com/v4/letter/a/ba9def/32.png) [@AK\_Cofig](https://discourse.nodered.org/u/AK_Cofig)
#### Post date: [7 June 2024 21:48 UTC](https://discourse.nodered.org/t/node-red-dashboard-form/88536/10 "2024-06-07T21:48:07Z")

</div>

For the right moment, the format is not my issue, just I need the right date and time to match my timezone.

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [7 June 2024 22:13 UTC](https://discourse.nodered.org/t/node-red-dashboard-form/88536/11 "2024-06-07T22:13:56Z")

</div>

Your sample form makes things unnecessarily complicated by returning it's value as `msg.payload["Date "]`. Once I got rid of that space it was much easier.

The ui-form returns the selected date as 00:00:00.0000 on that date, formatted as an ISO datetime string (Timezone Z or Zero or Zulu)

So at 23:08 GMT +1 on 7th June it returns` {"Date ":"2024-06-06T23:00:00.000Z"}`  
ie it converts my time (BST) to UTC and returns it as a string.

To get it back into GMT I need to convert it to a date object, eg with a function node.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/4/b4016bdb7838a900ae0585470902c8c1bd0bb47c.png)

```auto
[{"id":"383541189db48432","type":"ui_form","z":"0aa81f27b03a5529","name":"","label":"","group":"8f1d10f48f93aac5","order":2,"width":0,"height":0,"options":[{"label":"Date","value":"Date","type":"date","required":true,"rows":null}],"formValue":{"Date":""},"payload":"","submit":"Submit","cancel":"Cancel","topic":"payload","topicType":"str","splitLayout":true,"className":"","x":470,"y":140,"wires":[["c286b59ac9440f3c","4f13df494e3770e4"]]},{"id":"37414371a9b9a5cb","type":"debug","z":"0aa81f27b03a5529","name":"debug 19","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":780,"y":140,"wires":[]},{"id":"c286b59ac9440f3c","type":"function","z":"0aa81f27b03a5529","name":"function 1","func":"msg.payload = new Date(msg.payload.Date)\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":620,"y":140,"wires":[["37414371a9b9a5cb"]]},{"id":"4f13df494e3770e4","type":"debug","z":"0aa81f27b03a5529","name":"debug 41","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload[\"Date\"]","targetType":"msg","statusVal":"","statusType":"auto","x":620,"y":100,"wires":[]},{"id":"8f1d10f48f93aac5","type":"ui_group","name":"Default","tab":"f6e26b53496f9dcb","order":5,"disp":true,"width":"6","collapse":false,"className":""},{"id":"f6e26b53496f9dcb","type":"ui_tab","name":"Checkist ","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

```

---

<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: [8 June 2024 07:40 UTC](https://discourse.nodered.org/t/node-red-dashboard-form/88536/12 "2024-06-08T07:40:52Z")

</div>

> [@AK\_Cofig](#):
>
> I need the right date and time to match my timezone.

Note that you _are_ getting the right time. Your form is giving you 6th June, 22:00 UTC, which is exactly the same time as 7th June 00:00 CEST. Your issue is with the formatting. Do you want to see a string "07/06/24" or a Date object containing the timestamp or what?

A side question, are you committed to using the older dashboard or are you early enough in your development cycle that you could switch to the new dashboard @flowfuse/node-red-dashboard? The problem you have found (and it is confusing, I know) has been addressed by making the date form element return a string such as "2024-06-07". The dashboard is under very active development, there are still some missing features, but I have moved all my dashboards over.

---

<div class="post-metadata">

### Author: ![AK\_Cofig](https://avatars.discourse-cdn.com/v4/letter/a/ba9def/32.png) [@AK\_Cofig](https://discourse.nodered.org/u/AK_Cofig)
#### Post date: [8 June 2024 09:03 UTC](https://discourse.nodered.org/t/node-red-dashboard-form/88536/13 "2024-06-08T09:03:29Z")

</div>

Thank you very much @jbudd and @Colin for your informative reply about the format Date. Now I understand where this error comes from.  
I'm going to move to the new dashboard as well and hopefully, I can get rid of these funny errors.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [22 June 2024 09:04 UTC](https://discourse.nodered.org/t/node-red-dashboard-form/88536/14 "2024-06-22T09:04:26Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
