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 / Date picker show incor...
Power Apps
Unanswered

Date picker show incorrect date ( date retrieved from SQL server DB)

(0) ShareShare
ReportReport
Posted on by 8

I used date Picker in PowerApp, save the selected date into SQL Sever database.  The date value appeared to save into database correctly.  However, when I retrieved that date back out to an power app form, it always show 1 day less than the value saved in database.  For example,  I picked and saved 6/6/2019,  when retrieve that value, it show 6/5/2019.  I used SQL server database backend.

Any suggestion?

Thank you

Categories:
I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @tnguyen56 

    You will need to convert this from UTC to get the correct date.

    When you store your date in SQL it is stored in UTC values.  In order to get the correct date, you will need to apply the TimeZoneOffset function to it in order to adjust for your timezone time.

     

    To verify this, you can try to take a look at one of your dates and include the time - Text(yourSqlDate, "dd/mm/yyy hh:mm") - and you will most likely see that the time part is the issue.  If you are in a timezone that is negative UTC, then it will subtract that amount from the date of 6/6/2019 00:00.  So, if you are in -5 hour timezone, then 6/6/2019 00:00 becomes 6/5/2019 19:00 - and thus the day before you expect.

     

    I hope that is clear and helpful for you.

  • tnguyen56 Profile Picture
    8 on at

    Thank you.  

    It worked when I used  TimeZoneOffset  that you suggested

  • tnguyen56 Profile Picture
    8 on at

    Thank you.  

    It worked when I used  TimeZoneOffset  that you suggested

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