cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
andyJDL
Helper I
Helper I

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

6 REPLIES 6
samuelJ
Responsive Resident
Responsive Resident

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

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
Responsive Resident
Responsive Resident

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)

 

 

 

 

 

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
Responsive Resident
Responsive Resident

@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.  

MJB_PT
Frequent Visitor

Hi,

Sorry for the piggy backing., but I cannot put to work the DateAdd( DateToRead, TimeZoneOffSet (Now()), Minutes)


I have dates of upcoming events on a Share Point Online list qith a date&time type Column (PT: UTC+0). I'm filtering those dates on PowerApps for a dropdown box with selectable until the day of the event:
Filter('SharepointListName'.DayTimeColumn, Date(Day('DayTimeColumn'), Month(DayTimeColumn), Year('DayTimeColumn')) <= Now() )
However, I'm not getting the filtered dates in the PowerApps DropBox Items as desired and the ones I get present another format (US,  and - much worse than that - with surprising 6h plus (https://en.wikipedia.org/wiki/UTC%2B06:00)... No one, nor anything we have is on these countries...

SharePoint List Column (Ordered by date/time, but with the inserted out of filter scope dat inserted last to the SP List)

SharepointList.DateTime.Column.Ordered.pngAlready filtered as seen on PowerApps below the Edit Function (last entered date at the end of the LisT:

SharepointList.DateTime.Filtered_on_PowerApps.png

Previewing the App
PowerApps.DropBox.DateTime.Filtered.pngReading a few of the threads on the subject here, I've tried to apply
DateAdd( Filter('SharepointListName'.DayTimeColumn, Date(Day('DayTimeColumn'), Month(DayTimeColumn), Year('DayTimeColumn')) <= Now() ), TimeZoneOffSet (Now()), Minutes)

But I only get blank data...

How can I filter correctly , order by date/time the dropbox list and solve also TimeZone Offset?

Thanks in advance!

EDIT: Just solved the timezone problem apparently. One of our SysAdminOp entered the Sharepoint Online Site I'm using and changed the server timezone. Nonetheles, the PowerApps Admin console doesn't have a timezone available for the SysAdminOp in the "Gear" Menu that he can see and I cannot. Hope they are on the same one so that users timezone could be automatically adjusted. No need for Date Add function apparently (fingers crossed).

As to the filter not working, the Date syntax I used was misplaced (day with year...):

Filter('SharepointListName'.DayTimeColumn, Date(Day('DayTimeColumn'), Month(DayTimeColumn), Year('DayTimeColumn')) <= Now() )

Filter('SharepointListName'.DayTimeColumn, Date(Year('DayTimeColumn'), Month(DayTimeColumn), Day('DayTimeColumn')) <= Now() )

 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (65,879)