Skip to main content
Community site session details

Community site session details

Session Id : vF4U7NIqRl6h3T54GDFIxz
Power Apps - Building Power Apps
Answered

I need to roll back date picker if before 5 AM - Advice please

Like (0) ShareShare
ReportReport
Posted on 21 Mar 2021 19:49:10 by 83

I have a clock control UpdateContext({clockb:Text(Now(),"[$-en-US] hh AM/PM")})

 

So it reads out like so, 08 AM. I need to have date picker roll back one day in the text field if that control says 05 AM. Instead of 3/21/2021 it rolls to 3/20/2021.

 

I was playing with this in the label, If(clockb = "05 PM", adddays(datepicker.selecteddate,-1)) but I think I'm pretty off on my logic here. Can someone help me out please?

Categories:
  • Verified answer
    rubin_boer Profile Picture
    4,841 Super User 2024 Season 1 on 21 Mar 2021 at 20:51:00
    Re: I need to roll back date picker if before 5 AM - Advice please

    hi @PJaeger  try If(clockb = "10 PM",DatePicker1.SelectedDate-1,DatePicker1.SelectedDate)

     
  • PJaeger Profile Picture
    83 on 21 Mar 2021 at 20:09:10
    Re: I need to roll back date picker if before 5 AM - Advice please

    Ok fixed that, but still hung up on - If(clockb = "05 PM", adddays(datepicker.selecteddate,-1))

  • rubin_boer Profile Picture
    4,841 Super User 2024 Season 1 on 21 Mar 2021 at 20:05:48
    Re: I need to roll back date picker if before 5 AM - Advice please

    hi @PJaeger you have UpdateContext({clockb:Text(Now(),"[$-en-US] hh AM/PM")}) which will add a space before  "05 PM" try " 05 PM" or  UpdateContext({clockb:Text(Now(),"[$-en-US]hh AM/PM")})

     

    hope it helps

     

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

Announcing our 2025 Season 2 Super Users!

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June 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