Showing results for 
Search instead for 
Did you mean: 

Flow - Calculate Date Diference

Definition :- ticks(timestamp: string) - Returns the number of ticks (100 nanoseconds interval) since 1 Jan 1601  00:00:00 UT


Scenario :-


SharePoint list contains following columns:-


Title (Single Line of Text)

Contract Executed Date (Date)




 MS Flow :-


Get items from list














Run Select data operation to calculate number of days between Today's date and the Contract Executed Date













The expression for Days Since Contract Executed :-

ticks(formatDateTime(utcNow(),'yyyy-MM-dd') - Number of Ticks since 1 Jan 1601 and Today's Date
ticks(item()?['ContractExecutedDate']) - Number of Ticks since 1 Jan 1601 and Contract Executed date
sub - subtracting the number of ticks
div - divide the result from 864000000000 (conversion from nanoseconds to days)
Output of Select when Flow runs :-
Another use case would be to do date comparisons using Ticks
Filter all contracts which have Contract executed date in the last week
ticks(item()?['ContractExecutedDate']) - Number of Ticks since 1 Jan 1601 and Contract Executed date
ticks(formatDateTime(adddays( utcNow(),-7),'yyyy-MM-dd')) - Number of Ticks since 1 Jan 1601 and [Today's Date - 7 ] (in the last week)
utcNow() - current date and time
adddays( utcNow(),-7) - adds (-7) days to todays date 
formatDateTime(adddays( utcNow(),-7),'yyyy-MM-dd') - format the date time to date 'yyyy-MM-dd'
Check if ticks - Contract Executed date is greater than the ticks  - since Last week
Data in Contracts List :-

Flow - Filter using ticks expression
Flow - Select the filtered operation result and get Tile of contract
Result of Flow run for Select -
Only "Contract 2" is returned as it has Contract Executed Date since last week
Thanks for reading !!!

Hi Mdorrani,


Maybe you can help me with this:


I build the "Select" part of the flow based on this article, but i can't seem to use the output it gives me?





For me, worked this way:






Meet Our Blog Authors
  • Working daily with Microsoft Cloud to deliver the needs of my company, my customers and various Microsoft communities and forums. | Office 365 | Flow | PowerShell | PowerApps | SharePoint |
  • Co-founder of, Office 365 and SharePoint expert. Passionate about design and development of easy to use, convenient and flexible products.
  • Microsoft Business Apps MVP. Owner of ThriveFast, an Office 365 consulting company.
  • 7x Microsoft Business Solutions MVP (CRM)
  • I'm keen in MS technologies, SharePoint, Office 365 and development for them
  • Daniel is a Business Productivity Consultant & Microsoft Business Solutions MVP who is very enthusiastic about all things Office 365, Microsoft Flow, PowerApps, Azure & SharePoint (Online). Since the preview, Daniel has been working with Microsoft Flow and later on with Microsoft PowerApps. That led to him being awarded an MVP Award for Business Solutions. He loves to blog, present and evangelize about improving productivity in the modern workspace with these amazing tools!
  • Michelle is an Office 365 solution architect in Twin Cities, MN. She has been delivering business collaboration solutions for years with her focus on SharePoint and Office 365. Michelle is a recent board member of the Minnesota Office 365 User Group and has been a member of the SharePoint community since 2009. She is a frequent speaker at MNSPUG and SharePoint Saturday and co-chaired the Legal SharePoint User Group for 4 years. Her most frequent projects have involved rolling out a large deployment of Office 365, SharePoint Online intranet, build of a "CHAMPS" Office 365 user adoption program and most recently, SharePoint On-Premise to Online Migration. Michelle is very excited about cloud technology as it is shifting her IT Pro focus to collaboration strategy and technical adoption.
  • I'm a Microsoft Office Servers and Services MVP with a special interest in SharePoint, Office 365, Microsoft Flow, Microsoft Teams and PowerApps. I work at Triad Group Plc (
  • Passionate #Programmer #SharePoint #SPFx #Office365 #MSFlow | C-sharpCorner MVP | SharePoint StackOverflow, Github, PnP contributor