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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / SQL Server Time wrong ...
Power Apps
Unanswered

SQL Server Time wrong displayed in label field, two hour difference

(0) ShareShare
ReportReport
Posted on by 12

The field from the MS SQL Server shows "2017-08-24 09:00:00.000" (This field or the contents can not be changed).

When connected to a Label in PA it shows "24.08.2017 11:00" - which is a differenz of two hours. Is there a formatting option that would allow PA to show the correct time?  

As a workaround we are using "Text(DateAdd( ThisItem.mobStart; -2; Hours );"[$-de-DE]dd-mm-yyyy hh:mm" )" but we are unsure if this is the best way to work with this issue.

 

 

 

 

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    on at

    If your SQL is on Azure, it stores all dates in UTC format.

    All Datepicker controls have a DatetimeZone property that can be set to UTC or Local. 

     

    I am assuming you are -2 hours from UTC time? If that is the case and you want the date to match the one stored in SQL, then just change this property to UTC.

     

    Hope this helps

     

  • Jakubp Profile Picture
    6 on at
    I also got the same. At the moment your solution is the best workaround. You need to use adddate
  • Verified answer
    CarlosFigueira Profile Picture
    on at

    @Anonymous is correct - since the date is stored in Azure, it's assumed to be in the UTC time zone. And I'm assuming that the type of the column in your SQL table is datetime - which doesn't have any time zone information, so UTC is assumed.

     

    Currently Germany (again, assuming where you are, based on the [de-DE] that was added to your formula) is 2 hours ahead of UTC, so subtracting 2 hours will solve the problem. But if the date is outside the daylight saving time (DST) period (where it should be only 1 hour ahead of UTC), then it would not work.

     

    Ideally you would use a column type in SQL that has time zone information (such as datetimeoffset), but if that is not possible, then you can use the TimeZoneOffset function to add the appropriate time and that is also DST aware. If you set your formula to

    Text(
     DateAdd(
     ThisItem.mobStart;
     TimeZoneOffset(ThisItem.mobStart);
     Minutes);
     "[$-de-DE]dd-mm-yyyy hh:mm" )

    Then you should have the time that is represented in the SQL table show in your app.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard