Converting DateTime to dd/mm/yyyy hh:mm

No need to install extra nodes, as the change node has $moment() using JSONata expression. here is an example

[{"id":"a284d8c1.e2dd","type":"inject","z":"8d22ae29.7df6d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"$now()","payloadType":"jsonata","x":590,"y":1760,"wires":[["3be8855b.56d692","8a900799.717ad8"]]},{"id":"3be8855b.56d692","type":"change","z":"8d22ae29.7df6d","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$moment(payload).tz(\"Europe/London\").format('DD-MM-YYYY HH:mm') \t","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":1760,"wires":[["8a900799.717ad8"]]},{"id":"8a900799.717ad8","type":"debug","z":"8d22ae29.7df6d","name":"arrUpdateDate","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":990,"y":1760,"wires":[]}]
1 Like