Unix timestamp in snaplogic

Hello,

I’m trying to generate time in unix timestamp format. Is there a snap function which can perform this task?

Thanks,
Smit

Hi @smit66,

Yes you can convert datetime to unix timestamp with a Date Time Extractor snap.
First map the datetime in mapper:


Then use a Date Time Extractor snap:
image

Result:
image

1 Like

You can also do it more simply with this expression in a Mapper:

Math.floor(Date.now().getTime() / 1000)

1 Like

Thank you for your quick response.

Thanks for your response, I’m currently using this solution.