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)

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 160 members 4,373 guests
Please welcome our newest community members: