Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

convert string 1900-01-01T00:00:00.0000000Z to datetime and compare

(0) ShareShare
ReportReport
Posted on by 12

Hi, I'm storing datetime in text format as environment variable: 1900-01-01T00:00:00.0000000Z

 

PranavPh_1-1688570367666.png

 

 

In the flow, I'm reading a file and extracting datetime stamp. Now I want to compare the datetime from the file and update the environment variable if its greater. I'm facing issues in converting the text to the datetimestamp. 

 

1. Datetime being read from the flow

PranavPh_0-1688570304885.png

 

Need help in the conversion and then just want to compare if date1 > date2 then.. action. 

 

Regards,

Pranav 

 

  • Verified answer
    v-mingkz-msft Profile Picture
    Microsoft Employee on at
    Re: convert string 1900-01-01T00:00:00.0000000Z to datetime and compare

    Hi @PranavPh,

    Do you want to convert the string to datetime stamp, and compare them?

    I did some text according to your requirements.

    Following is my flow.

    1. You can use formatDateTime() function to convert the datetime if the string date match ISO 8601.

    vmingkzmsft_0-1688614125749.png

    vmingkzmsft_1-1688614290938.png

     

     

    formatDateTime(variables('Date string'),'yyyy-MM-ddThh:mm:ss')

     

     

    Best Regards,

    Kyrie

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

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,535 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,908 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow