Handling time zone in Power Automate
The example described in this post shows how a date field selected in Dynamics 365 (where the timezone is GMT+11hrs) can be incorrectly displayed in Power Automate. Specifically, a date of 15/03/2021 in Dynamics 365 being incorrectly displayed as 14/03/2021 in Power Automate. It then describes a solution to this issue.
Issue
Consider the field ‘Agreement Date’
![](https://dustinminer.com/wp-content/uploads/2021/03/1-1.png)
The ‘Agreement Date’ value is selected
![](https://dustinminer.com/wp-content/uploads/2021/03/2a.png)
When the date is stored in Dataverse, it’s stored as GMT+0hrs
![](https://dustinminer.com/wp-content/uploads/2021/03/3a-3.png)
When the date is read into Power Automate, it’s incorrectly set to the previous day
![](https://dustinminer.com/wp-content/uploads/2021/04/4-Copy.png)
Solution
Set the format for the field as ‘Date and Time’
![](https://dustinminer.com/wp-content/uploads/2021/03/5-Copy-1.png)
The time is now also displayed on the form. To hide this, add the following JavaScript to the form on load event
FormContext.getControl(“<publisher>_agreementdate”).setShowTime(false);
![](https://dustinminer.com/wp-content/uploads/2021/03/2c-1.png)
When the date is read in Power Automate, it now displays the time as well
![](https://dustinminer.com/wp-content/uploads/2021/04/4-Copy-later.png)
The agreement date is then converted from GMT+0hrs to GMT+11hrs (1 extra hour for daylight savings)
![](https://dustinminer.com/wp-content/uploads/2021/03/6b.png)
The date now correctly displays within Power Automate
![](https://dustinminer.com/wp-content/uploads/2021/03/7c-1.png)