Forum Discussion

smit66's avatar
smit66
New Contributor II
5 years ago

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

4 Replies

  • 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:

    Result:

    • smit66's avatar
      smit66
      New Contributor II

      Thank you for your quick response.

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

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

    • smit66's avatar
      smit66
      New Contributor II

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