Azure Logic Apps

Abhay Chandramouli 921 Reputation points


I want to convert a given utcNow() time stamp in logic apps to unix timestamp like 1666861645116.

Please let me know an expression to do this .. I am unable to achieve the same using liquid's "now" function.

Please let me know how to do this using logic apps expressions or liquid methods (which are acceptable by logic apps)

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,555 questions
{count} votes

Accepted answer
  1. RevelinoB 1,960 Reputation points

    Hi Abhay, To convert the current UTC time in Logic Apps to a Unix timestamp, you can use the following expression:

    "@div(sub(ticks(utcNow()), ticks('1970-01-01T00:00:00Z')), 10000)"

    • utcNow() should retrieve the current UTC time.
    • ticks('1970-01-01T00:00:00Z') gives the Unix epoch start time.
    • sub(ticks(utcNow()), ticks('1970-01-01T00:00:00Z')) calculates the difference between the current time and the epoch start time in ticks.
    • div(..., 10000) divides the tick difference by 10,000 to convert it to milliseconds (Unix timestamp format).

    The summarize this expression will give you the Unix timestamp in milliseconds.

    I hope this helps?

    0 comments No comments

0 additional answers

Sort by: Most helpful