# Time parsing - how to cut up time messages

**URL:** <https://discourse.nodered.org/t/time-parsing-how-to-cut-up-time-messages/19485>\
**Category:** General\
**Created:** [22 December 2019 23:37 UTC](https://discourse.nodered.org/t/time-parsing-how-to-cut-up-time-messages/19485 "2019-12-22T23:37:23Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [23 December 2019 00:45 UTC](https://discourse.nodered.org/t/time-parsing-how-to-cut-up-time-messages/19485/4 "2019-12-23T00:45:27Z")

</div>

> [@Trying\_to\_learn](#):
>
> I want an array. (mgs.blah) with the values.  
> It isn't happening.

Indeed. According to the split node help

The behaviour of the node is determined by the type of `msg.payload` :

The output of the moment node is a string, so the split node will disregard the configuration you entered for copying key to msg.blah.

You want to transform a string into an array. This is similar to what has been discussed in this post

> [@Convert csv string to array](https://discourse.nodered.org/t/convert-csv-string-to-array/19088/4):
>
> Right, but can be fixed by using a join node after the split node, with below config. [a-1]

You can apply the same solution, a split node + join node.

Testing flow:

```auto
[{"id":"5a4f00a0.1539d","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"9496950a.d98538","type":"inject","z":"5a4f00a0.1539d","name":"Foo","topic":"","payload":"foo","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":280,"wires":[["a8bc1ecd.231c"]]},{"id":"a8bc1ecd.231c","type":"function","z":"5a4f00a0.1539d","name":"","func":"msg.payload = new Date().toLocaleString();\nreturn msg;","outputs":1,"noerr":0,"x":250,"y":280,"wires":[["e98349ab.6a3558"]]},{"id":"e98349ab.6a3558","type":"moment","z":"5a4f00a0.1539d","name":"","topic":"","input":"","inputType":"msg","inTz":"Australia/Sydney","adjAmount":0,"adjType":"days","adjDir":"add","format":"HH:mm:ss","locale":"en_AU","output":"","outputType":"msg","outTz":"Australia/Sydney","x":420,"y":280,"wires":[["6f0835.a09d27cc"]]},{"id":"f0b653ec.00866","type":"debug","z":"5a4f00a0.1539d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":850,"y":280,"wires":[]},{"id":"6f0835.a09d27cc","type":"split","z":"5a4f00a0.1539d","name":"","splt":":","spltType":"str","arraySplt":"2","arraySpltType":"len","stream":false,"addname":"","x":590,"y":280,"wires":[["79820f63.5886a"]]},{"id":"79820f63.5886a","type":"join","z":"5a4f00a0.1539d","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":710,"y":280,"wires":[["f0b653ec.00866"]]}]

```

---

_[View the full topic](https://discourse.nodered.org/t/time-parsing-how-to-cut-up-time-messages/19485)._
