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 / compare date time to d...
Power Apps
Answered

compare date time to different time zones

(0) ShareShare
ReportReport
Posted on by 249

I have an app that is used across multiple regions (US, UK, EU, etc...). I need to limit the use of certain parts of the app during specific set times. When I use the code below in the Visible property of the controls, it only allows for people in the US to enter due to the date format for different regions. 

Now()<DateTimeValue("4/20/2021, 12:01:00 AM") || Now() >= DateTimeValue("5/19/2021, 12:01:00 AM")

 

I was thinking that I need to adjust the code to:

 

Text(Now(), dd/mm/yyyy)<Text(DateTimeValue("4/20/2021, 12:01:00 AM"), dd/mm/yyyy hh:mm:ss) || Text(Now(), dd/mm/yyyy) >= Text(DateTimeValue("5/19/2021, 12:01:00 AM"), dd/mm/yyyy hh:mm:ss)

 

But receive an error that it expected text. Where am I going wrong? I just need to have it available during these dates and times for users in all regions, regardless of their date/time format.

 

Categories:
  • Verified answer
    timl Profile Picture
    37,424 Super User 2026 Season 2 on at

    @techtudoor 

    If you specify the locale in your call to DateTimeValue, that will ensure that the function parses your input date/time in the correct format.

    Now()<DateTimeValue("4/20/2021, 12:01:00 AM", "en-US") || Now() >= DateTimeValue("5/19/2021, 12:01:00 AM", "en-US")

     

  • techtudoor Profile Picture
    249 on at

    @timl , Thank you

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 232 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 202 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard