Format moment.js output

Hey All,
I'm working with moment.js to write a time stamp to a txt file. I have it working but
the output looks like this.

56o563nt().for56pmt('March 1, 2023 6:56 PM');

I want it to format like this

March 1, 2023 6:56 PM

How can I do this?
Thanks
Rich

Example Flow

[{"id":"d259eab47cf07c40","type":"inject","z":"54efb553244c241f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":260,"y":4080,"wires":[["9b3f875e6284e0f6"]]},{"id":"9b3f875e6284e0f6","type":"change","z":"54efb553244c241f","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$moment().format(\"MMMM D, YYYY hh:mm A\")","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":4080,"wires":[["4e07d54d66d7e4b0"]]},{"id":"4e07d54d66d7e4b0","type":"debug","z":"54efb553244c241f","name":"debug 34","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":620,"y":4080,"wires":[]}]

Information on token formatting with momentjs can be found here

Thanks it works!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.