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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Condition for if time ...
Power Apps
Answered

Condition for if time now is equal to or greater than 4pm

(0) ShareShare
ReportReport
Posted on by 802

Hi,

 

I want a condition whereby if the selected date in a date picker is tomorrow AND the time now is greater than or equal to 4pm (UK time), throw an error in the app...

 

So far I have 

And(RailOutDatePicker.SelectedDate = Today(+1) && Now() >= ),

 

What do I need to do to complete the Now part for the time?

 

Cheers

K.

Categories:
  • Verified answer
    Sundeep_Malik Profile Picture
    6,501 on at

    Hey @Kosenurm 

     

    I stored UTC time in one label. Then saved just 4pm in another label.

     

    You can keep these hidden and compare the values of both.

     

    This is how I did it:

     

    To get utc Time:

     

    Sundeep_Malik_0-1668870197103.png

     

    Saved in Label 7

     

    To get just hours 4pm:

     

    Sundeep_Malik_1-1668870233004.png

     

    Saved in Label2

     

    Now I compared both of them:

     

    Sundeep_Malik_2-1668870273996.png

     

     

    And are you sure, that Today(+1) would work??

    If not you can store it like this:

    Sundeep_Malik_3-1668870313205.png

     

     

    I hope this helps. 🙂

  • Verified answer
    v-liwei-msft Profile Picture
    Microsoft Employee on at

    Hi @Kosenurm 

     

    You can use this formula in DatePicker's Onselect property:

    If(TimeValue(Now())>=TimeValue("16:00 PM")&&Text(DateAdd(Today(),1,Days),"mm-dd-yyyy")=Text(DatePicker3.SelectedDate,"mm-dd-yyyy"),Notify("Error",NotificationType.Error))

     

    Best Regards,

    Levi

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 221 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 120

Last 30 days Overall leaderboard