# How to get array using split node?

**URL:** <https://discourse.nodered.org/t/how-to-get-array-using-split-node/35983>\
**Category:** General\
**Created:** [16 November 2020 05:34 UTC](https://discourse.nodered.org/t/how-to-get-array-using-split-node/35983 "2020-11-16T05:34:10Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [16 November 2020 07:47 UTC](https://discourse.nodered.org/t/how-to-get-array-using-split-node/35983/2 "2020-11-16T07:47:07Z")

</div>

You can convert the timestamps in the change node using jsonata and moment function. e.g.

```auto
[{"id":"8d63e49.f8f8198","type":"inject","z":"8d22ae29.7df6d","name":"","props":[{"p":"payload","v":"","vt":"str"},{"p":"topic","v":"","vt":"string"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"str","x":70,"y":1800,"wires":[["13c1586b.5c3538"]]},{"id":"13c1586b.5c3538","type":"function","z":"8d22ae29.7df6d","name":"Get array date time","func":"var arrLastModDate = [];\n\narrLastModDate.push('2020-04-07T10:00:56.000Z');\narrLastModDate.push('2020-04-07T09:45:32.000Z');\narrLastModDate.push('2020-04-07T09:47:04.000Z');\narrLastModDate.push('2020-04-07T09:48:54.000Z');\narrLastModDate.push('2020-04-07T09:50:28.000Z');\n\nmsg.payload = arrLastModDate;\n\nreturn msg;","outputs":1,"noerr":0,"x":230,"y":1800,"wires":[["3bb419f.4559a66"]]},{"id":"3bb419f.4559a66","type":"change","z":"8d22ae29.7df6d","name":"","rules":[{"t":"set","p":"arrUpdateDate","pt":"msg","to":"$map(payload, function($v){\t$moment($v).tz(\"Asia/Tokyo\").format('YYYY-MM-DD HH:mm:ss') \t})","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":1800,"wires":[["49e75bf9.5de18c"]]},{"id":"49e75bf9.5de18c","type":"debug","z":"8d22ae29.7df6d","name":"arrUpdateDate","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"arrUpdateDate","targetType":"msg","x":630,"y":1860,"wires":[]}]

```

---

_[View the full topic](https://discourse.nodered.org/t/how-to-get-array-using-split-node/35983)._
