web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Convert dateDifference to days

(0) ShareShare
ReportReport
Posted on by 1,159

Hi,

I have an output of -20:58:33.2982132 which is the result of running dateDifference from now to a Due Date field.

dateDifference(utcNow(),item()['DueDate'])

How do I convert this to days only? (I've tried split and substring functions but cant get it right)

Thanks in advance

Todd

I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    on at
    Re: Convert dateDifference to days

    Hi @Tango ,

     

    Please try

    div(sub(ticks(utcNow()),ticks(item()['DueDate'])),864000000000)

     

    Best Regards,
    Bof

  • jdavisp3 Profile Picture
    6 on at
    Re: Convert dateDifference to days

    The answers aren't really saying how to do this with dateDifference. You can use int and split:

    int(split(dateDifference(utcNow(), item()['DueDate']), '.')[0])
  • tbartman Profile Picture
    3 on at
    Re: Convert dateDifference to days
    Thank you jdavisp3 - that did the trick!
    concat(int(split(dateDifference(utcNow(),
    '2025-02-28'), '.')[0]), ' Days Remaining')

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 797 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 425 Moderator

#3
developerAJ Profile Picture

developerAJ 319

Last 30 days Overall leaderboard