cancel
Showing results for 
Search instead for 
Did you mean: 

Unix timestamp in snaplogic

smit66
New Contributor II

Hello,

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

Thanks,
Smit

4 REPLIES 4

j_angelevski
Contributor III

Hi @smit66,

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

Result:
image

smit66
New Contributor II

Thank you for your quick response.

ptaylor
Employee
Employee

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

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

smit66
New Contributor II

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