web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / PowerApps time zone error
Power Apps
Unanswered

PowerApps time zone error

(0) ShareShare
ReportReport
Posted on by 45

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

Categories:
I have the same question (0)
  • SJ-15052312-0 Profile Picture
    418 on at

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

  • andyJDL Profile Picture
    45 on at

    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

  • SJ-15052312-0 Profile Picture
    418 on at

    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 Profile Picture
    45 on at

    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?

  • SJ-15052312-0 Profile Picture
    418 on at

    @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 Profile Picture
    25 on at

    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() )

     

  • DwayneT Profile Picture
    10 on at

    Converting to UTC

    To convert to UTC (Coordinated Universal Time), add the TimeZoneOffset for the given time.

    For example, imagine the current date and time is July 15, 2013, 1:02 PM in Pacific Daylight Time (PDT, UTC-7). To determine the current time in UTC, use:

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

    TimeZoneOffset defaults to the current time, so you don't need to pass it an argument.

    To see the result, use the Text function with the format dd-mm-yyyy hh:mm, which will return 15-07-2013 20:02.
    Converting from UTC

    To convert from UTC, subtract the TimeZoneOffset (by adding the negative) for the given time.

    For example, imagine the UTC date and time July 15, 2013, 8:02 PM is stored in a variable named StartTime. To adjust the time for the user's time zone, use:

    DateAdd( StartTime, −TimeZoneOffset( StartTime ), Minutes )

    Note the negative sign before TimeZoneOffset to subtract the offset rather than add it.

    To see the result, use the Text function with the format dd-mm-yyyy hh:mm, which will result in 15-07-2013 13:02 if you're in Pacific Daylight Time.

     

    Greeting,
    DwayneT

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard