# Fill text input with timestamp from integers

**URL:** <https://discourse.nodered.org/t/fill-text-input-with-timestamp-from-integers/47061>\
**Category:** Dashboard\
**Created:** [12 June 2021 10:09 UTC](https://discourse.nodered.org/t/fill-text-input-with-timestamp-from-integers/47061 "2021-06-12T10:09:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![steifhahn](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@steifhahn](https://discourse.nodered.org/u/steifhahn)\
**Post date:** [12 June 2021 10:09 UTC](https://discourse.nodered.org/t/fill-text-input-with-timestamp-from-integers/47061/1 "2021-06-12T10:09:16Z")

</div>

Hello out there!

I am having a text input configured as time picker which sends hour and minute to my PLC.  
Now i try to read back the value from the PLC.  
So i have an integer "hour" and one integer "minute".

Is it possible tr make a valid timestamp from these two?

many greetings

---

<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:** [12 June 2021 19:36 UTC](https://discourse.nodered.org/t/fill-text-input-with-timestamp-from-integers/47061/2 "2021-06-12T19:36:57Z")

</div>

Welcome to the forum @steifhahn

That depends on what you mean by a valid timestamp. If you mean a JavaScript timestamp then you also need the date and timezone.

---

<div class="post-metadata">

**Author:** ![steifhahn](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@steifhahn](https://discourse.nodered.org/u/steifhahn)\
**Post date:** [13 June 2021 08:13 UTC](https://discourse.nodered.org/t/fill-text-input-with-timestamp-from-integers/47061/3 "2021-06-13T08:13:45Z")

</div>

Thx Colin.

Ok i got it working. Was easier than expected, maybe i thought too dificult. Because info of text inpute states:

> "The time input type returns a number of milliseconds from midnight."

And i had in mind that dates starts from 1970.....

---

<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:** [13 June 2021 20:01 UTC](https://discourse.nodered.org/t/fill-text-input-with-timestamp-from-integers/47061/4 "2021-06-13T20:01:40Z")

</div>

> [@steifhahn](#):
>
> And i had in mind that dates starts from 1970...

Javascript timestamps do start from 1970 and are measured in msec. That is why I said at the start that the solution depends on what you mean by a 'valid timestamp'.

---

<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:** [13 July 2021 20:02 UTC](https://discourse.nodered.org/t/fill-text-input-with-timestamp-from-integers/47061/5 "2021-07-13T20:02:20Z")

</div>

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