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

PowerApps time zone error

I have an app using local times data generated in Hawaii (for instance 8am).  

 

When viewing the app in NC, it should read as 6 hrs earlie (so 2am), but it shows up in PowerApps as 4 hours earlier (4am).

 

Anyone have a suggestion?  I've checked my time zone settings in my Office 365 profile, Outlook, and in Dynamics.

 

Andy

5 REPLIES 5
samuelJ
Level 8

Re: PowerApps time zone error

What is your flow of information?  Where is the time being stored in between sessions? For example we use PowerApps > SSMS > PowerApps.

andyJDL
Level: Powered On

Re: PowerApps time zone error

I'm not sure how to answer that questions, but the data is on a Hawaii server with an on-premise gateway connecting two SQL databases, which are sharing data to the PowerApp.

 

Andy

samuelJ
Level 8

Re: PowerApps time zone error

Yes I was asking where you data was being stored, SQL server, share point, etc.  Looks like SQL Server 

 

I had a similar issue, we enter a date/time in powerapps and it gets stored in sql server, later we pull it back into powerapps to view, people in many different timezones use this app.  Our problem was that powerApps would take the local time zone the date/time was being entered in, convert that to UTC for sql server and then back to local time zone for what ever device was trying to view the time.  So it could have been PST > UTC > HKT so we ended up with lots of different problems.

 

To solve it we did this when writing to the DB:

 

DateAdd( SomeDateValue , -TimeZoneOffset(Now()), Minutes)

Then when reading from the DB we did this. 

DateAdd( SomeDateValue , TimeZoneOffset(Now()), Minutes)

 

 

 

 

 

andyJDL
Level: Powered On

Re: PowerApps time zone error

Thanks, 

 

I get that PowerApps converts to the local time of the user, but this appears to be different from that.

All of the data is written in Hawaii, so in theory 8am Hawaii should get converted to 2am in NC.  But instead the app shows it as 4am.  I can't seem to figure any logic that would cause that.

 

Am I missing some aspect of the problem you experience that might be more similar than I realize?

samuelJ
Level 8

Re: PowerApps time zone error

@andyJDL,

 

**My solution assumes you are not trying to format the time anywhere in powerApps or somewhere else but using the local time on the device. 

 

I apologize if I am not explaining this correctly.  Time zones are very frustrating in PowerApps.  I know what your problem is, I am having trouble explaining it. 

 

8:00 AM in Hawaii is 2:00 PM in EST.  

 

Capture.PNG

So your logic is PowerApps > SQL Server > PowerApps.  8:00 AM Hawaii time in powerApps, gets put into SQL Server as UTC (6:00 PM), then that gets put back into powerApps.  So (Here I assume you are trying to tell powerApps to use Hawain time, which is how you get 4 AM) 6PM UTC (being read as HST, if you are specifiying this) = 4:00 AM.  If you do the above code I showed, it should fix this problem.  

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 103 members 5,176 guests
Please welcome our newest community members: