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 : GuPoAukNvcKvy7X6QGasoF
Power Apps - Building Power Apps
Answered

How to convert MM/DD/YYYY date text into Date object?

Like (0) ShareShare
ReportReport
Posted on 5 Jul 2021 13:19:44 by

Hello,

 

I have date text in format MM/DD/YYYY as "07/02/2021"

 

I require to evaluate, if "07/02/2021" is greater than today.

 

How can I do that, for some reason following formula throws null value for label, therefore I am unable to evaluate - can you help?

 

Text(DateValue("07/02/2021",DateTimeFormat.ShortDate))

 

Thanks,

 

  • CarlosFigueira Profile Picture
    on 05 Jul 2021 at 14:25:29
    Re: How to convert MM/DD/YYYY date text into Date object?

    If you know that the date will always be in the "mm/dd/yyyy" format, you can pass the second parameter to the DateValue function that specifies which locale it will be used (for example, "en-US" uses that format). You can then compare that date with Today():

    If(
     DateValue("07/02/2021", "en-US") > Today(),
     "July 2nd is greater than today",
     "July 2nd is not greater than today")

    You mentioned that the formula that you have is having an error; that is because the second parameter to the DateValue function is the language to use when converting from text to dates. The DateTimeFormat enumeration can be used to as a parameter to the Text function.

  • Verified answer
    BCBuizer Profile Picture
    22,264 Super User 2025 Season 2 on 05 Jul 2021 at 13:40:14
    Re: How to convert MM/DD/YYYY date text into Date object?

    You can use:

    DateDiff(Now(),DateValue("07/02/2021"))>0

     

    BCBuizer_0-1625492238105.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

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Loading complete