# Converting Unix Time thru Moment

**URL:** <https://discourse.nodered.org/t/converting-unix-time-thru-moment/19840>\
**Category:** General\
**Created:** [2 January 2020 21:56 UTC](https://discourse.nodered.org/t/converting-unix-time-thru-moment/19840 "2020-01-02T21:56:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chucksteele](https://avatars.discourse-cdn.com/v4/letter/c/f1d935/32.png) [@chucksteele](https://discourse.nodered.org/u/chucksteele)\
**Post date:** [2 January 2020 21:56 UTC](https://discourse.nodered.org/t/converting-unix-time-thru-moment/19840/1 "2020-01-02T21:56:36Z")

</div>

I am grabbing the sunrise (payload.daily.data[0].sunriseTime) and sunset (payload.daily.data[0].sunsetTime) times from the DarkSky node. As its Unix time, I multiply it by 1000, then convert it using two Moment nodes, which outputs each one as a string (and the correct time in the correct format)  
So a couple of scenarios.

1. If I take the individual outputs and enter into the template, it overwrites the other one. Makes sense, I think.
2. If I put them thru the join node, I get an "undefined".

I can display them in the dashboard individually in a template (which will be cumbersome), so it seems I must be missing something. Any ideas?

---

<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:** [2 January 2020 22:12 UTC](https://discourse.nodered.org/t/converting-unix-time-thru-moment/19840/2 "2020-01-02T22:12:46Z")

</div>

Make sure each one has a different topic, then configure the join node in key/value pair mode.  
See [this page in the cookbook](https://cookbook.nodered.org/basic/join-streams).

---

<div class="post-metadata">

**Author:** ![chucksteele](https://avatars.discourse-cdn.com/v4/letter/c/f1d935/32.png) [@chucksteele](https://discourse.nodered.org/u/chucksteele)\
**Post date:** [3 January 2020 01:38 UTC](https://discourse.nodered.org/t/converting-unix-time-thru-moment/19840/3 "2020-01-03T01:38:19Z")

</div>

Thanks, I do have this flow that I have been using as my guide and have two separate topics.

Where I made my mistake, is that I was naming the outputs specifically vs generically. (e.g. msg.payload.alerttime) vs msg.payload. So when the join received the two outputs after the Moment magic, it was receiving two unique msg.playloads. Renamed the Moment outputs to msg.playload and problem solved.

SO the real problem is was overthinking what I needed to do vs letting the topics do all the heavy lifting...
