Using $moment() in change node jsonata 'Test' results in an error

Strange, as working here

Try this flow

[{"id":"4c8fe74d.23b62","type":"inject","z":"8d22ae29.7df6d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[     {         \"time\": 1608813423311,         \"humidity\": 36.7     },     {         \"time\": 1608813423511,         \"humidity\": 35.5     } ]","payloadType":"json","x":160,"y":2380,"wires":[["6040a378.a42784","84c9d74a.048ca8"]]},{"id":"6040a378.a42784","type":"change","z":"8d22ae29.7df6d","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload ~> |[*]|{\"time\":$moment(time).tz(\"london/europe\").format(\"hh:mm a\")}|\t\t","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":2380,"wires":[["84c9d74a.048ca8"]]},{"id":"84c9d74a.048ca8","type":"debug","z":"8d22ae29.7df6d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":520,"y":2280,"wires":[]}]