# Understand UI time input data format

**URL:** <https://discourse.nodered.org/t/understand-ui-time-input-data-format/10624>\
**Category:** General\
**Created:** [28 April 2019 20:00 UTC](https://discourse.nodered.org/t/understand-ui-time-input-data-format/10624 "2019-04-28T20:00:52Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![manueldiasmanuel](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@manueldiasmanuel](https://discourse.nodered.org/u/manueldiasmanuel)\
**Post date:** [28 April 2019 20:00 UTC](https://discourse.nodered.org/t/understand-ui-time-input-data-format/10624/1 "2019-04-28T20:00:52Z")

</div>

Hi,

I am using text input in dashboard / UI to set time.

What is the output format of the time set ?

When i set time to 01:00 i received the value 3600000 . How could i convert this number to "readable" and how could i split the number in Hours and minutes ?

Regards,

MD

---

<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:** [28 April 2019 20:25 UTC](https://discourse.nodered.org/t/understand-ui-time-input-data-format/10624/2 "2019-04-28T20:25:26Z")

</div>

Maybe this will help

 ![35%20PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/3/3f81a205fffbc21e788e45b0120fd52d3a162b25.png)

---

<div class="post-metadata">

**Author:** ![manueldiasmanuel](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@manueldiasmanuel](https://discourse.nodered.org/u/manueldiasmanuel)\
**Post date:** [28 April 2019 21:00 UTC](https://discourse.nodered.org/t/understand-ui-time-input-data-format/10624/3 "2019-04-28T21:00:40Z")

</div>

Yes it helps. I should have seen that . Thanks,

How to convert and split this number in Hours and Minutes ?

MD

---

<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:** [28 April 2019 21:04 UTC](https://discourse.nodered.org/t/understand-ui-time-input-data-format/10624/4 "2019-04-28T21:04:43Z")

</div>

the node node-red-contrib-moment might be useful

---

<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:** [28 April 2019 21:12 UTC](https://discourse.nodered.org/t/understand-ui-time-input-data-format/10624/5 "2019-04-28T21:12:06Z")

</div>

alternatively there are lots of tutorials on line about javascript time, and use what you find in a function node

---

<div class="post-metadata">

**Author:** ![manueldiasmanuel](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@manueldiasmanuel](https://discourse.nodered.org/u/manueldiasmanuel)\
**Post date:** [29 April 2019 14:58 UTC](https://discourse.nodered.org/t/understand-ui-time-input-data-format/10624/6 "2019-04-29T14:58:25Z")

</div>

zenofmud ,

Thanks , the node-red-contrib-moment gives me the output \> payload: "2019-04-29T09:27:30.839Z".  
Now my problems is hot to extract Hour and Minutes and split them ? I thought Node-Red would be only graphic but it requires knowledge that i don´t have 🙂 .

ukmoose ,

I was googling in a wrong direction. Thanks for showing me a better path to search.

I will try !

MD

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [29 April 2019 15:22 UTC](https://discourse.nodered.org/t/understand-ui-time-input-data-format/10624/7 "2019-04-29T15:22:24Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/f/fff9b66fa7f7d60384441ed365dab929afa0c6d5.png) may be something like this?

---

<div class="post-metadata">

**Author:** ![manueldiasmanuel](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@manueldiasmanuel](https://discourse.nodered.org/u/manueldiasmanuel)\
**Post date:** [29 April 2019 16:58 UTC](https://discourse.nodered.org/t/understand-ui-time-input-data-format/10624/8 "2019-04-29T16:58:47Z")

</div>

👍 Uau , great tip. Thank you very much. I can even separate hour and minutes without writing code !!

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/6/6e21ba7fd3fbbbe2cb9e1476b67b6032bd97803d.png)

Perfect !

Regards,

MD

---

<div class="post-metadata">

**Author:** ![manueldiasmanuel](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@manueldiasmanuel](https://discourse.nodered.org/u/manueldiasmanuel)\
**Post date:** [29 April 2019 17:14 UTC](https://discourse.nodered.org/t/understand-ui-time-input-data-format/10624/9 "2019-04-29T17:14:24Z")

</div>

Is possible to change the UI dashboard to output format time format as 23:00 instead of 11:00 PM ?

Regards,

MD

---

<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:** [29 April 2019 17:18 UTC](https://discourse.nodered.org/t/understand-ui-time-input-data-format/10624/10 "2019-04-29T17:18:06Z")

</div>

which output node are you using and what does it say in the info tab for the node?

---

<div class="post-metadata">

**Author:** ![Achronite](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/achronite/32/31868_2.png) [@Achronite](https://discourse.nodered.org/u/Achronite)\
**Post date:** [29 April 2019 17:26 UTC](https://discourse.nodered.org/t/understand-ui-time-input-data-format/10624/11 "2019-04-29T17:26:55Z")

</div>

You can have ultimate control if you use a function node. For example:

```auto
let d = new Date();
let day = d.getDay(); // Sun=0
let daysmins = d.getHours()*60+d.getMinutes();

```

All the date javascript functions are described here: [https://www.w3schools.com/js/js\_date\_methods.asp](https://www.w3schools.com/js/js_date_methods.asp)

---

<div class="post-metadata">

**Author:** ![manueldiasmanuel](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@manueldiasmanuel](https://discourse.nodered.org/u/manueldiasmanuel)\
**Post date:** [30 April 2019 07:50 UTC](https://discourse.nodered.org/t/understand-ui-time-input-data-format/10624/12 "2019-04-30T07:50:20Z")

</div>

Hi,

I am very newbie on this subject so ; my understanding is that " d " is the variable " new Date ( ) but how should i know that adding a " d." to getHours() gives me a result ? Where can i learn this sintax ?

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/5/5e608eaaf9d89715783e472e4adba956c9164fd9.png)

Regards

MD

---

<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:** [30 April 2019 08:24 UTC](https://discourse.nodered.org/t/understand-ui-time-input-data-format/10624/13 "2019-04-30T08:24:40Z")

</div>

[https://duckduckgo.com/?q=javascript+date+methods&t=h\_&ia=web](https://duckduckgo.com/?q=javascript+date+methods&t=h_&ia=web)

---

<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:** [30 April 2019 08:42 UTC](https://discourse.nodered.org/t/understand-ui-time-input-data-format/10624/14 "2019-04-30T08:42:25Z")

</div>

`d` is better described as a variable which references a Date object, which is set to the current date/time.  
When you use `d.something` you are asking the Date object referenced by `d` to do something, in this case to call a member function `Date.getHours()` which is documented in many places which can be found as suggested by ukmoose. The w3schools site is a good place for information on javascript (and other web stuff).

---

<div class="post-metadata">

**Author:** ![manueldiasmanuel](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@manueldiasmanuel](https://discourse.nodered.org/u/manueldiasmanuel)\
**Post date:** [30 April 2019 12:36 UTC](https://discourse.nodered.org/t/understand-ui-time-input-data-format/10624/15 "2019-04-30T12:36:03Z")

</div>

Thanks for the explanation and links. Another doubt ;

Below an excerpt of a function to convert a number format.

**var newMsg = { payload: decimal };** \> This adds the value of Variable decimal to payload , right ? Where or what should i search for learning this syntax ?  
**return newMsg;**

Thks

Regards

MD

---

<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:** [30 April 2019 12:41 UTC](https://discourse.nodered.org/t/understand-ui-time-input-data-format/10624/16 "2019-04-30T12:41:18Z")

</div>

There are numerous examples on the node-red website and lots of javascript tutorials on he web

[https://duckduckgo.com/?q=learning+simple+javascript+objects+&t=h\_&ia=web](https://duckduckgo.com/?q=learning+simple+javascript+objects+&t=h_&ia=web)

---

<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:** [30 April 2019 12:42 UTC](https://discourse.nodered.org/t/understand-ui-time-input-data-format/10624/17 "2019-04-30T12:42:00Z")

</div>

> [@manueldiasmanuel](#):
>
> **var newMsg = { payload: decimal };** \> This adds the value of Variable decimal to payload , right ?

It doesn't _add_ the value of decimal to the msg.payload, it sets newMsg to an object that has a property payload which has the value from the variable decimal.  
These are basic javascript features, so any javascript tutorial or documentation will teach you these concepts. Though the problem with javascript tutorials is that they tend to assume you are using the js in a website with html, whereas here it is being used as a standalone language. Whether anyone can recommend a particular one I don't know.

---

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [30 April 2019 21:26 UTC](https://discourse.nodered.org/t/understand-ui-time-input-data-format/10624/18 "2019-04-30T21:26:27Z")

</div>

> [@Colin](#):
>
> the problem with javascript tutorials is that they tend to assume you are using the js in a website with html

True, and often annoying. The w3schools site has a separate [section](https://www.w3schools.com/nodejs/default.asp) on node.js that uses examples from running server-side programs and provides a programming tool. I haven't used it much, so I can't vouch for its quality.

---

<div class="post-metadata">

**Author:** ![azan5050](https://avatars.discourse-cdn.com/v4/letter/a/bc79bd/32.png) [@azan5050](https://discourse.nodered.org/u/azan5050)\
**Post date:** [26 September 2025 11:44 UTC](https://discourse.nodered.org/t/understand-ui-time-input-data-format/10624/19 "2025-09-26T11:44:15Z")

</div>

> [@Datetime formating issue](https://discourse.nodered.org/t/datetime-formating-issue/99169):
>
> Create a dashboard with two datetime inputs. Convert these UTC times to the server's local time and format them for SQL Server's smalldatetime type. Then, query the database for records within that range and send the results to a chart. 26/09/2025, 16:22:54node: debug 15 sensor\_data\_query : msg.payload : Object object query: string SELECT [Id], [SensorName], [SensorValue], [Alert], [Timestamp] FROM [IndustrialDB].[dbo].[SensorData] WHERE [Timestamp] BETWEEN ? AND ? …

kindly reply here

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [26 September 2025 11:47 UTC](https://discourse.nodered.org/t/understand-ui-time-input-data-format/10624/20 "2025-09-26T11:47:54Z")

</div>

Hi, you are replying to a post from 6 years ago.

I am closing this thread.

[Next page](https://discourse.nodered.org/t/understand-ui-time-input-data-format/10624.md?page=2)
