cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ramanan89
Helper III
Helper III

How to validate date and time greater than current date and time in Power Apps

Hi,

I am trying to validate Date and Time field in form, so that when user picks the value from Date and time it should be greater than current date time. Power Apps has divided the time and date into three fields, So I am not sure how to validate that 
Screenshot 2020-07-07 at 11.02.02 PM.png

Any help will be great. Thanks 🙂

1 ACCEPTED SOLUTION

Accepted Solutions
EricLott
Community Champion
Community Champion

Here is a formula to build the datetime from the multiple values. If you're using a 24 hour timestamp, then the am/pm is not necessary. This just returns the string "True" or "False" based on if the datetime is greater than the current timestamp.

If(DateTimeValue(DatePicker2.SelectedDate & " " & hourValue.Selected.Value & ":" & minuteValue.Selected.Value & " " & ampmValue.Selected.value) > Now(),"True","False")

 Let me know if you have any questions

---
If this answered your question, please click "Accept Solution". If this helped, please Thumbs Up.

View solution in original post

2 REPLIES 2
EricLott
Community Champion
Community Champion

Here is a formula to build the datetime from the multiple values. If you're using a 24 hour timestamp, then the am/pm is not necessary. This just returns the string "True" or "False" based on if the datetime is greater than the current timestamp.

If(DateTimeValue(DatePicker2.SelectedDate & " " & hourValue.Selected.Value & ":" & minuteValue.Selected.Value & " " & ampmValue.Selected.value) > Now(),"True","False")

 Let me know if you have any questions

---
If this answered your question, please click "Accept Solution". If this helped, please Thumbs Up.

It worked thank you 🙂

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,077)