Hi, I came across a scenario in power automate where I had to calculate the date difference using power automate. I had to calculate number of days difference between todays date and when the item was created in a SharePoint list. I thought it can help other power automate developers in the community, hence made this video and uploaded to the KZitem channel.
Expression: In the below code, add the desired column to calculate the date difference dynamically inside last ticks method.
div(sub(ticks(formatDateTime(utcNow(),'yyyy-MM-dd')),ticks()),864000000000)
I am calculating the days difference, you can calculate hours, min, seconds and milliseconds difference by changing the divided by figure in above expression accordingly.
Ticks per day 864,000,000,000
Ticks per hour 36,000,000,000
Ticks per minute 600,000,000
Ticks per second 10,000,000
Ticks per millisecond 10,000
Негізгі бет How to Calculate the Date Difference using Power Automate
Пікірлер: 56