cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lnpapin
Level: Powered On

Date display format between Azure SQL and Powerapps

On azure SQL database, I have no difficulty to use datetime2/datetime column format using PowerBI or others way to connect to the DB but when I'm using Powerapps, using the same credential and connectivity infos I've got around ~5h of offset between the display and the db information. looks like there is somes timezone issue between my azure sql server and powerapps usage. if it can help I'm localted in montreal so we use EST-5

 

1 ACCEPTED SOLUTION

Accepted Solutions
PowerApps Staff CarlosFigueira
PowerApps Staff

Re: Date display format between Azure SQL and Powerapps

The datetime/datetime2 columns in SQL Azure don't have any time zone information (if you can, I'd recommend using datetimeoffset instead); when the information arrives in PowerApps, it assumes that it came from UTC, and when the date is shown in PA, by default it is presented in the local time zone.

 

You can use the TimeZoneOffset function to "adjust" the value to the dates that came from SQL. For example, if you are displaying it in a label as

ThisItem.ColumnName

Then you can use this instead:

DateAdd(ThisItem.ColumnName, TimeZoneOffset(ThisItem.ColumnName), Minutes)
1 REPLY 1
PowerApps Staff CarlosFigueira
PowerApps Staff

Re: Date display format between Azure SQL and Powerapps

The datetime/datetime2 columns in SQL Azure don't have any time zone information (if you can, I'd recommend using datetimeoffset instead); when the information arrives in PowerApps, it assumes that it came from UTC, and when the date is shown in PA, by default it is presented in the local time zone.

 

You can use the TimeZoneOffset function to "adjust" the value to the dates that came from SQL. For example, if you are displaying it in a label as

ThisItem.ColumnName

Then you can use this instead:

DateAdd(ThisItem.ColumnName, TimeZoneOffset(ThisItem.ColumnName), Minutes)