Need current Unix time in payload

Hello, I'm new here so please excuse me if I've jumped the gun by creating a topic for this.

  • I need to add a UNIX time to a HTTP URL in order to retrieve data for a given time.
    I have tried to use timestamp but that returns the time in milliseconds rather than seconds and I am no proficient enough in python to do the calculation and then pass the value to the URL.

Long story short, how do I convert a msg.payload which equals timestamp in milliseconds to msg.payload equal to unix time in seconds.

I hope someone can help and I hope this helps others because I have searched online and found a thousand ways to convert from unix time but no way to return to unix time.

Thanks

Hi Joe,

Unless I misunderstand the question, I think you can do that with JSONata in a Change node:
Untitled 3

That’s fantastic, worked perfectly, thanks.

Possibly better to round rather than floor.

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