cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Power Apps Staff CarlosFigueira
Power Apps 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)

View solution in original post

1 REPLY 1
Power Apps Staff CarlosFigueira
Power Apps 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)

View solution in original post

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (3,988)