# How to convert time format in this node

**URL:** https://discourse.nodered.org/t/how-to-convert-time-format-in-this-node/62135
**Category:** General
**Tags:** function-node
**Created:** [3 May 2022 17:16 UTC](https://discourse.nodered.org/t/how-to-convert-time-format-in-this-node/62135 "2022-05-03T17:16:59Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![SammyJang](https://avatars.discourse-cdn.com/v4/letter/s/e56c9b/32.png) [@SammyJang](https://discourse.nodered.org/u/SammyJang)
#### Post date: [3 May 2022 17:16 UTC](https://discourse.nodered.org/t/how-to-convert-time-format-in-this-node/62135/1 "2022-05-03T17:16:59Z")

</div>

Hello, I'm a grad student of mechanical engineering. Now I'm working on a project that is related to programming using Node-Red.  
I'm having a little problem in the function node which is I cannot convert the existing time stamp format to more human readable format. I was following the Node-Red essential video, but I'm stuck in this section. I put a code in the function node, but it doesn't work in the debug node.  
Any advices will be very helpful to me. Thank you so much!

 ![timestamp](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/d/adf9fe94b69059303a0fc526a19a4ba94131472c.png)

---

<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: [3 May 2022 17:36 UTC](https://discourse.nodered.org/t/how-to-convert-time-format-in-this-node/62135/2 "2022-05-03T17:36:51Z")

</div>

Is that thee dots after the equals? Try removing them.

---

<div class="post-metadata">

### Author: ![SammyJang](https://avatars.discourse-cdn.com/v4/letter/s/e56c9b/32.png) [@SammyJang](https://discourse.nodered.org/u/SammyJang)
#### Post date: [3 May 2022 17:55 UTC](https://discourse.nodered.org/t/how-to-convert-time-format-in-this-node/62135/3 "2022-05-03T17:55:35Z")

</div>

Oh nah that's just for showing the code in one screen shot. Original code has no three dots  
Thank you!

---

<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: [3 May 2022 18:06 UTC](https://discourse.nodered.org/t/how-to-convert-time-format-in-this-node/62135/4 "2022-05-03T18:06:01Z")

</div>

Well what you have (minus the `...` is valid.

Here is proof in a REPL...

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

are you looking at the debug from before or after the function? (show us your flow)

---

<div class="post-metadata">

### Author: ![edje11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/edje11/32/572_2.png) [@edje11](https://discourse.nodered.org/u/edje11)
#### Post date: [3 May 2022 18:28 UTC](https://discourse.nodered.org/t/how-to-convert-time-format-in-this-node/62135/5 "2022-05-03T18:28:32Z")

</div>

![Capture](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/4/6408bbba0cd55a36a60992b8f3b0b6763915252b.png)  
Click in the debug window on the blue timestamp and see what happens, you will get human readable output.

---

<div class="post-metadata">

### Author: ![SammyJang](https://avatars.discourse-cdn.com/v4/letter/s/e56c9b/32.png) [@SammyJang](https://discourse.nodered.org/u/SammyJang)
#### Post date: [3 May 2022 19:33 UTC](https://discourse.nodered.org/t/how-to-convert-time-format-in-this-node/62135/6 "2022-05-03T19:33:33Z")

</div>

OMG I made a baaaaad mistake. I didn't put my node after the function... Thank you!

---

<div class="post-metadata">

### Author: ![SammyJang](https://avatars.discourse-cdn.com/v4/letter/s/e56c9b/32.png) [@SammyJang](https://discourse.nodered.org/u/SammyJang)
#### Post date: [3 May 2022 19:33 UTC](https://discourse.nodered.org/t/how-to-convert-time-format-in-this-node/62135/7 "2022-05-03T19:33:49Z")

</div>

Yes! This is working too. Thank you!

---

<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: [17 May 2022 19:34 UTC](https://discourse.nodered.org/t/how-to-convert-time-format-in-this-node/62135/8 "2022-05-17T19:34:08Z")

</div>

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