Skip to Content

Power Apps | Timezone Calculator

January 8, 2026 by
Power Apps | Timezone Calculator
TxTechnician, Andrew Valenzuela
| No comments yet

Time is no one's friend.  Timezones.... even less so. 

Power Apps automatically calculates the time based on UTC.  This means, DST (Daylight Savings Time) & localization are already handled for you.  

Any time/date function in Power Apps will automatically account for your local timezone.  In my case that timezone is UTC-06:00​ (USA Central).  

The timezone is set in your PC or in your web browser.  Not in the Power Apps application.

PowerFx Timezone HTML

Instructions: Paste this in an HTML Control's - HTMLText property.
Loading code from Forgejo...

In my timezone (UTC-06:00) we use Daylight Savings Time.  Notice how the UTC Offset​ (amount in minutes that must be subtracted or added to Universal Coordinated Time) changes when DST is active in June.

This is super helpful.... unless you're trying to make a "Timezone Calculator".



Timezone Calculator Screen

Instructions: Paste this YAML into a Canvas App. This will add a new Screen to your app, with all the code. IMPORTANT: At the end of this article is an Automated solution. Which uses OfficeScript and an Excel workbook. The code in this Screen is static. Which was done for the simple reason that I want you to be able to do "ONE" copy/paste action to learn PowerFx.
Loading code from Forgejo...

Every major programming language has some way to interact with the UTC and Timezone data.  

The static data in the: Timezone Calculator Screen example was generated using python.  

The dynamic data in the: Automated Timezone Calculator Screen example was generated using Typescript run in an Excel spreadsheet.


The headache of timezones, and the simple solution to managing them in Power Apps.

These timezones change all the time.  Politics mostly, It's annoying.

Global standard time is managed by one international organization:  
International Bureau of Weights and Measures
(note that there are further levels of bureaucracy such as NIST, IERS, USNO, etc... But the "global standard" (UTC) is managed by this organization.  )

Whereas "Timezones" are managed by another international organization:
Internet Assigned Numbers Authority

IANA manages a timezone database that most systems use.  Including most programing libraries. (python, javascript, etc...)

In Power Apps there is the option to use Power Automate's   Convert a time zone

But, like all things "Power Automate", it's clunky and slower than a native solution.

I prefer to just use a local collection with the appropriate timezone offsets.  (note that if you use a local collection, you will need to keep it updated manually).  
Or to use an external database as a reference. (see the end of the article for a free one that is available to any M365 for Business user).


How Power Apps handles date time strings.

Power Apps uses .net libraries (C#) to parse Date & Time strings.  

These strings can be any number of standard date time formats:

C# date time formats

And even combinations of date and time formats that are not standard (such as the format I used in my examples mm/dd/yyyy hh:mm PM/AM UTCOffset​).

It's really robust and mimics Excel's date time formatting feature (except it doesn't change the info when you don't want it to).  

Different libraries handle date & time calculations differently.  But they all use the same international data sets to make the calculations.  




Building a Power Apps collection with Python.

I used Python​ to make a static collection of timezone data.  It is a wiser idea to use an automated external source.  Which I did with Typescript​ (This is the language used in Excel) and an Excel Table.

Python Timezone Collection Generator

Instructions: Run this .py to generate powerfx code.
Loading code from Forgejo...

Python is my go-to language for everything.  It's widely adopted and has a ton of features.  But Python isn't something simple to integrate into Power Apps.  (not in the way I need it to be for this solution).  

What is available & easy to integrate in Power Apps is Excel Tables.  Which can be built using  OfficeScript (TypeScript library in MS Office)


Automated Timezone Calculator Screen

Instructions: Paste this YAML into a Canvas App. This will add a new Screen to your app, with all the code. IMPORTANT: For this solution to work you must:
  1. Create an excel workbook in M365.
  2. Add the Office Script to the workbook.
  3. Implement the Power Automate OfficeScript Run command
  4. Link the table as a datasouce in Power Apps
Loading code from Forgejo...

Instructions:

  1. Paste this YAML into a Power App.
  2. Create a spreadsheets stored in SharePoint or OneDrive.
    1. Add the script to your sheet using the Automate Tab: OfficeScript
    2. The script is down below.  
    3. Run the script once (the table will auto generate).
  3. Create a Power Automate scheduled flow.
    1. Connector name is:  Excel -> Run Script from SharePoint Library (or just "Run Script" if it's in your OneDrive)
  4. Add the Excel Table as a data source in your Power App.
  5. Update the two Comboboxes​ as per the comments in the Items​ property.

OfficeScript Excel Table of Timezones

Instructions: Add this script to an excel sheet and run it.
Loading code from Forgejo...





Sign in to leave a comment