Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

calculate how many days the sharepoint file was created

(0) ShareShare
ReportReport
Posted on by 102

Eu preciso calcular quantos dias o arquivo do sharepoint foi criado, o que eu pensei que era para usar a função utcnow() - data de criação do arquivo do sharepoint. Mas como fazer essa conexão?

  • Verified answer
    Expiscornovus Profile Picture
    31,648 Most Valuable Professional on at
    Re: calculate how many days the sharepoint file was created

    Hi @jurunas2023,


    That is -2 days. So, if you only want the days you should be able to use a split function for that (with a split on the dot character). 

     

    split(dateDifference(outputs('Get_file_properties')?['body/Created'],utcNow()), '.')[0]

     

  • jurunas2023 Profile Picture
    102 on at
    Re: calculate how many days the sharepoint file was created

    Now, how do you convert the function value to days?

    For example: the date created is 2022-12-28T20:27:50.000000Z and today's date as end gives the following number -2.01:16:29.7916441

     

  • Expiscornovus Profile Picture
    31,648 Most Valuable Professional on at
    Re: calculate how many days the sharepoint file was created

    Hi @jurunas2023,

     

    You could use an expression with a dateDifference function for this.

     

    dateDifference('<startDate>', '<endDate>')

     

    Below is an example

     

    dateDifference(outputs('Get_file_properties')?['body/Created'],utcNow())

     

    datedifference_function.png

     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,702 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow