Here is the flow I've used to replicate your input data, the function node and it's output.
[{"id":"f95d0f7f.50a1","type":"inject","z":"9ba1ec76.07e4d8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":80,"wires":[["177ecb03.83bef5"]]},{"id":"e0fb2f1d.5195d","type":"function","z":"9ba1ec76.07e4d8","name":"","func":"var z0 = msg.payload[2]\nvar z1 = msg.payload[3]\nvar d = new Date()\nvar t0 = d.getHours() \nvar t1 = d.getMinutes()\nif(t1<10){t1='0'+t1}\nvar t2 = d.getDate()\nvar t3 = d.getMonth() + 1\nvar t4 = d.getFullYear()\nvar t = t0+\":\"+t1\nvar tt = t2+\"/\"+t3+\"/\"+t4\nvar a = '';\na = z0 +\",\" + t +',' + tt + \"\\n\";\na += z1 +\",\" + t +',' + tt + \"\\n\";\nmsg.payload = a;\nreturn msg;","outputs":1,"noerr":0,"x":490,"y":80,"wires":[["215c5afc.7e2b96"]]},{"id":"215c5afc.7e2b96","type":"debug","z":"9ba1ec76.07e4d8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":670,"y":80,"wires":[]},{"id":"177ecb03.83bef5","type":"function","z":"9ba1ec76.07e4d8","name":"","func":"msg.payload = []\nmsg.payload[0] = '200'\nmsg.payload[1] = '300'\nmsg.payload[2] = '400'\nmsg.payload[3] = '500'\n\nreturn msg;","outputs":1,"noerr":0,"x":310,"y":80,"wires":[["e0fb2f1d.5195d","1c14e297.e5133d"]]},{"id":"1c14e297.e5133d","type":"debug","z":"9ba1ec76.07e4d8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":490,"y":160,"wires":[]}]
you might want to compare it to what you have coded
2/20/2020, 4:50:07 AMnode: 1c14e297.e5133d
msg.payload : array[4]
[ "200", "300", "400", "500" ]
2/20/2020, 4:50:07 AMnode: 215c5afc.7e2b96
msg.payload : string[38]
string[38]
400,9:50,20/2/2020
500,9:50,20/2/2020