Blog
Times - How to spoof the current timezone in Power Apps
March 10. 2022
If you're building apps with users from different time zones, here's a simple way to spoof the time zone for testing purposes.
When building apps with users across different time zones,
it can be very useful to change the time zone that's reported in Power Apps for test purposes.
An example test scenario is a scheduling app that adds appointments to a shared calendar. By changing the time zone, we can verify that the app saves and displays the expected date/time values correctly across multiple regions.
A common way to carry out this testing is to setup another computer and to configure the time zone setting to match the target region.
However, an easier way to accomplish this is to modify the time zone through the Developer Tools in the Google Chrome or Microsoft Edge browsers.
How to open the Developer Tools in Chrome or Edge
The quickest way to open the Developers Tools is to press the CtrlShifti shortcut combination. Alternatively, we can open the Developer Tools by clicking the ... menu item, and selecting 'More Tools' > 'Developer Tools'.
When the Developer Tools panel opens, we select 'More Tools' > Sensors (as shown below).
From the Sensors section, we can then select one of the built-in locations.
We can also click the 'Manage' button to enter a custom location. For each location, we can assign a Timezone.
How to change the timezone of a Power Apps session
If I run the Now() function, Power Apps returns a time of 07:03. It's currently 15:03 in my current timezone, which verifies that Power Apps has correctly reported the Pacific timezone.
How to change the language of the Power Apps Designer
Note that's it's also possible to use this same technique to change the language of the Power Apps designer. If I now change my location to Tokyo and refresh the browser, the Power Apps designer opens in Japanese.
Conclusion
When
building apps for use in multiple regions, a quick and simple
way to change the time zone and language of an app is to set the location through the Sensors pane of the Developer Tools in Chrome or Edge.
- Categories:
- datetimes
Related posts