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 / Date Picker Incorrect ...
Power Apps
Answered

Date Picker Incorrect Date & Drop

(0) ShareShare
ReportReport
Posted on by 430

I'm having a nightmare with datepickers and getting the correct date to show. I would also like to be able to drop the time and have the date only if anyone has a solution for that.

 

Bit of background. Been having a nightmare with dates in Powerapps from day one. Had to use all sorts of fiddles to get the ISO format to work (as opposed to mm/dd/yy which was default) And now I'm flat getting the incorrect date. Seems to be since the clock changed.

 

So I have a form where users can submit holiday requests, which of course has a date picker for start dates. If a user now pics 23/4/2019 as their start date and then submits the form, the date that appears in my SQL table is 22/4/2019 23:00:00

 

11pm the day before!

 

What I would like is if a user selects 23/4/2019 as the start date, then 23/4/2019 appears in the datasource, as selected, without the time.

I have the format of the date picker set to ""dd/mm/yy" And the update for that datacard is "DateValue5.SelectedDate". On selecting a confirm buttin I use "SubmitForm(FormName)" and that's when I get the incorrect date.

 

Has anyone seen anything like this in terms of having the incorrect date appear or found a way to drop the time. I had tried for the update field "DateValue(DateValue5.SelectedDate)" to no avail.

 

Would changing DateTimeZone.Local to .UTC have any effect (I have a strong feeling what powerapps thinks is my "local" region is not my 'local' region)

 

Also, does UTC in this context handle daylight savings?

Categories:
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @seanbrogan 

    Your SQL dates are going to be in UTC.  So, you simply need to adjust for that and store a UTC date.

    Have a look at the TimeZoneOffset function. This will give you some more details.

     

    What you need to do is to change your Update property to

       DataAdd(DateValue5.SelectedDate, TimeZoneOffset(DateValue5.SelectedDate), Minutes)

     

    To display the proper value, you'll want to convert from UTC.  So set your Default property of the DataCard to:

       DateAdd(yourSqlDateField, -TimeZoneOffset(yourSqlDateField), Minutes)

     

    Daylight savings time is handled by your regional settings which are accounted for in the Date functions in powerapps.  UTC is "universal" and does not change by regional changes.  And, again, UTC is the default for your SQL...so you just need to do the conversion. 

     

    I hope this is helpful for you.

  • seanbrogan Profile Picture
    430 on at

    Thanks @RandyHayes 

     

    I've got it working at the moment. I deleted the "start date" card from the form and added a new one. Then chaned that to DateTimeZone.UTC. I set the hour and minute value to default to "00" and hid them from the user.

    Now if a user selectes 23/4/19 in the date picker I get 23/4/19 00:00 in my SQL table. I would prefer without the time at all but this is managable for now.



    Thanks for your help.

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard