I ran into an unexpected issue while working on a Power Automate flow. I needed to compare two dates: today’s date and a date five days in the future. I used the formatDateTime() function to format the dates, but when I applied the condition to check if today’s date was greater than today + 5 days, the flow incorrectly returned “Yes.”
After some research, I discovered the issue was due to string-based comparisons rather than actual date values. The solution? The ticks() function! It converts dates into numerical values, making comparisons accurate.
In this tutorial, I will tell you what is Power Automate ticks function and how to compare date using ticks() function in Power Automate.
ticks Function in Powet Automate
The ticks() function converts a date into a numeric value representing. This number counts tiny time units (100-nanosecond intervals) from the year 0001. Since it’s just a number, comparing dates becomes easy and accurate.
Syntax:
ticks(timestamp)- timestamp: The date and time value you want to convert into ticks.

Example:
If today is Feb 24, 2025, then:
ticks(utcNow())
The last few numbers may vary because of the time.
Check out How to Auto Generate Serial Number in Power Automate?
Compare Date using the ticks() Function in Power Automate
Now, I will show how to compare. For this, I am checking if today’s date exceeds today + 5 days. Let’s see how to do it.
1. Create an Instant Cloud Flow by selecting the ‘Manually trigger a flow’ trigger action.

2. Add a compose action and provide the below expression, which converts today’s date to ticks:
ticks(utcNow())
3. Again, add the compose action and provide the below expression:
ticks(addDays(utcNow(),5))- utcNow() – Returns the current date and time in UTC.
- addDays(utcNow(),5) – Adds 5 days to the current date.
- ticks(…) – Converts the resulting date-time value into a tick count.

4. Add a Condition action to compare which is the greater:
- Left Side: Select the Today Ticks (from Dynamic Content).
- Operator: is greater than
- Right Side: Select the Future Ticks (from Dynamic Content).

5. Inside the true section, add the compose action and provide the below expression:
formatDateTime(utcNow(),'dd/MM/yyyy')
6. Inside the false section, add another compose action and provide the below expression :
formatDateTime(addDays(utcNow(),5),'dd/MM/yyyy')
Save your flow and manually trigger it using the Run button. Then you can see the false part run because 01/03/2025 (Today + 5 days) is greater than 24/02/2025 (Today Date).

Conclusion
In this tutorial, I explained the issue with comparing dates in Power Automate due to string-based comparisons and learned the ticks() function as the solution. I covered the Power Automate Ticks function, how it converts dates into numeric values, and how to use it for accurate date comparisons.
Related Power Automate tutorials:
- Power Automate isInt() Function
- Power Automate slice() Function
- Power Automate concat() Function
- Power Automate indexOf() Function
- Easiest Way to Validate Phone Number Column in SharePoint

After working for more than 18 years in Microsoft technologies like SharePoint, Microsoft 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (12 times). I have also worked in companies like HP, TCS, KPIT, etc.