Say a support ticket opened at 8:15 AM UTC on November 2, 2026 and closed at 5:45 PM UTC on November 10. To Power Automate calculate date difference for it, subtract the two ticks() values and divide by the unit you want.
That one pattern gives you 201 hours, 12090 minutes, or a readable “8 days, 9 hours, 30 minutes.” The built-in dateDifference() only hands back a text timespan.
In this tutorial, I’ll show you how to Power Automate calculate date difference in every unit people ask for, including months and age in years, where the obvious math gets it wrong.
The Sample Dates We’ll Use
Every method below uses the same two timestamps, so you can compare the results directly:
- Start:
2026-11-02T08:15:00Z(Monday, 8:15 AM UTC) - End:
2026-11-10T17:45:00Z(Tuesday, 5:45 PM UTC) - True gap: 8 days, 9 hours, and 30 minutes
The 30 extra minutes matter. They show which methods round, which truncate, and which keep the fraction. For whole days only, there’s a separate guide to the date difference in days.
To run any expression, add a Compose action, click Inputs, type /, choose Insert expression, paste it, and select Add.
How Ticks Turn Dates Into Numbers
ticks() returns the number of 100-nanosecond intervals since January 1, 0001. Subtract two of them and you get the gap as one big integer. Then divide by a fixed number for each unit:
| Unit | Divide by |
|---|---|
| Day | 864000000000 |
| Hour | 36000000000 |
| Minute | 600000000 |
| Second | 10000000 |
| Week | 6048000000000 |
Moving a date instead of measuring it? That’s the addDays() function.
Method 1: Divide Ticks for Hours, Minutes, or Seconds (Recommended)
Use this when you need a number for an SLA check, a condition, or a report. Same sample dates. Here’s the expression for hours:
div(sub(ticks('2026-11-10T17:45:00Z'),ticks('2026-11-02T08:15:00Z')),36000000000)
It returned 201. Swap the divisor and minutes returned 12090, seconds returned 725400, days returned 8, and weeks returned 1.
How does this work? The gap is 8 days and 9.5 hours, which is 201.5 hours. div() on two integers drops the remainder, so you get 201 whole hours.
Need the fraction? Make the divisor a decimal. This returned 201.5:
div(sub(ticks('2026-11-10T17:45:00Z'),ticks('2026-11-02T08:15:00Z')),36000000000.0)
Pro Tip: Run view shows 12090 as “12,090”. The comma is only display; the real output has no comma. If you later turn text into a number, see converting a string to an integer.
Method 2: Read the dateDifference() Timespan
Use this when a person, not a formula, will read the result. Same two dates:
dateDifference('2026-11-02T08:15:00Z','2026-11-10T17:45:00Z')

It returned 8.09:30:00. Swap the dates and it returned -8.09:30:00.
How does this work? The text before the dot is days; the rest is hours, minutes, and seconds. To pull out one piece, split it. This returned 30, the minutes part:
int(split(dateDifference('2026-11-02T08:15:00Z','2026-11-10T17:45:00Z'),':')[1])
Important: under one day there’s no dot (for example 12:00:00), so splitting on the dot breaks. Method 1 doesn’t have that problem.
Method 3: Build a Readable “X Days, Y Hours” Text
Use this for email or Teams messages. Same sample again, with mod() to keep the leftover after each unit:
concat(div(sub(ticks('2026-11-10T17:45:00Z'),ticks('2026-11-02T08:15:00Z')),864000000000),' days, ',div(mod(sub(ticks('2026-11-10T17:45:00Z'),ticks('2026-11-02T08:15:00Z')),864000000000),36000000000),' hours, ',div(mod(sub(ticks('2026-11-10T17:45:00Z'),ticks('2026-11-02T08:15:00Z')),36000000000),600000000),' minutes')

It returned 8 days, 9 hours, 30 minutes.
How does this work? The first div() gives whole days. mod() keeps what’s left after those days, and the next div() turns it into hours. Minutes repeat the same move.
Drop that text into a message body, or into a table with Create HTML table.
Method 4: Count Months and Years
There’s no tick count for a month, because months have 28 to 31 days. Compare the calendar parts instead. For January 15 to November 10, 2026, this returned 10 calendar months:
sub(add(mul(int(formatDateTime('2026-11-10','yyyy')),12),int(formatDateTime('2026-11-10','MM'))),add(mul(int(formatDateTime('2026-01-15','yyyy')),12),int(formatDateTime('2026-01-15','MM'))))
How does this work? Each date becomes “year times 12 plus month,” and the two numbers are subtracted. To count only full months, subtract 1 when the end day is smaller than the start day. With dayOfMonth(), that returned 9.
Age in years needs the same care. For someone born November 11, 1990, dividing the ticks by 365 days returned 36:
div(sub(ticks('2026-11-10'),ticks('1990-11-11')),315360000000000)

That’s wrong; the birthday is tomorrow, so they’re 35. The leap days push the count over. This calendar version returned 35, and 36 for a birthday that falls on the run date:
sub(sub(int(formatDateTime('2026-11-10','yyyy')),int(formatDateTime('1990-11-11','yyyy'))),if(less(formatDateTime('2026-11-10','MMdd'),formatDateTime('1990-11-11','MMdd')),1,0))
For moving a date by months instead of counting them, see adding months to a date.
Method 5: Difference Between Two SharePoint Columns
Now the same ticks math on real list data. My Customer Requests list has the built-in Created column (date and time) and a date-only DueDate. I added a Select after Get items with two keys:
DaysCreatedToDue: if(empty(item()?['DueDate']),null,div(sub(ticks(item()?['DueDate']),ticks(startOfDay(item()?['Created']))),864000000000))
HoursOpen: div(sub(ticks(utcNow()),ticks(item()?['Created'])),36000000000)

Row 1 returned 9 days, row 8 returned -1 (due the day before it was created), and blank due dates returned null. startOfDay() drops Created’s time so a 6:18 PM entry doesn’t lose a day. The Select action guide covers the mapping.
Which Method Should You Use?
| You need | Use | My result |
|---|---|---|
| Hours, minutes, seconds as numbers | Ticks divided by a unit | 201 / 12090 / 725400 |
| Hours with decimals | Ticks divided by a decimal | 201.5 |
| A readable timespan | dateDifference() | 8.09:30:00 |
| Text for an email | Ticks with div() and mod() | 8 days, 9 hours, 30 minutes |
| Months or age | Calendar parts with formatDateTime() | 10 months, age 35 |
To act on the number, put it in a condition, like the ones in checking if a date is before today.
I’d start with ticks every time and only reach for dateDifference() when someone will read the raw value.
Things to Keep in Mind
- Blank dates fail. ticks() and dateDifference() both need a string, so guard with
if(empty(...)), as in checking if a date field is empty. - Timestamps are UTC. Created and utcNow() are UTC, so convert first if “same day” depends on Eastern time.
- Negative means reversed. If the start is later than the end, every method returns a negative value.
- div() truncates. 23 hours is 0 days; use a decimal divisor or startOfDay() when that matters.
Frequently Asked Questions
How do I calculate the difference between two dates in Power Automate?
Subtract the ticks and divide by the unit: div(sub(ticks(end),ticks(start)),36000000000) gives hours. My test returned 201.
How do I get the date difference in minutes?
Divide the tick difference by 600000000. For November 2, 8:15 AM to November 10, 5:45 PM, it returned 12090.
What does dateDifference return in Power Automate?
A timespan as text, such as 8.09:30:00 for days.hours:minutes:seconds. Microsoft documents it in the expression functions reference.
How do I calculate months between two dates?
Compare year times 12 plus month for each date with formatDateTime(). Ticks can’t do it because months vary in length.
How do I calculate age in Power Automate?
Subtract the years, then subtract 1 if the birthday’s MMdd hasn’t been reached yet. Dividing ticks by 365 days can be a year too high.
More Date Math Tutorials
If you’re working on date logic, these pair well with it:
- subtracting days from a date
- getting yesterday’s date
- checking whether a date is today
- formatting dates with formatDateTime()

Bijay Kumar is a 13-times Microsoft MVP in Business Applications with over 18 years of experience in the IT industry, recognized for his contributions to the Microsoft community. He is the Founder of TSinfo Technologies and shares practical, tested tutorials on Power Apps, Power Automate, Copilot Studio, and Power BI here on Power Platform FAQs. Read more.