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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Date to integer conver...
Power Automate
Unanswered

Date to integer conversion in power automate

(0) ShareShare
ReportReport
Posted on by 18

What is a good date to integer conversion example for comparing 2 dates in the flow. I am using the Created field from Sharepoint and the Utc(Now).

Categories:
I have the same question (0)
  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @niki1 

     

    Use the formatDateTime() expression to convert to yyyy-MM-dd.

     

    formatDateTime(utcNow(), 'yyyy-MM-dd')

     

    Similar expression for created field also.

     

    Thanks

  • niki1 Profile Picture
    18 on at

    Thanks for the response. 

    Do you know how to format the UTC(Now) date to a format like    2023-02-22T17:52:03Z.  

     

    I tried your code and still get an error as follows.

    Unable to process template language expressions in action 'Initialize_variable' inputs at line '0' and column '0': 'In function 'formatDateTime', the value provided for date time string 'Created' was not valid. The datetime string must match ISO 8601 format.'.

  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @niki1 

     

    In order to give you an exact answer I need to see your flow screenshot. Could you please post a screenshot of your flow and another screenshot of your failure.

     

    Thanks

  • niki1 Profile Picture
    18 on at

    Hi, I have attached the ss.

    Thanks

  • niki1 Profile Picture
    18 on at

    It did not work. I tried it with quotes, without quotes, still no go...

    The expression "'2023-02-23' eq 2023-02-23" is not valid. Creating query failed.

  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @niki1 

     

    You could still use the same format for comparison but that variable need to declare as string.

     

    If you want to convert to a number then use the below format.

     

    formatDateTime(utcNow(), 'yyyyMMdd')

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard