cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
lstod
Level: Powered On

Date Picker Changes to Wrong Date

I am having an issue that i've been struggling with for the past few hours with regards to the Date Picker Data card.  I have a simple form that has a start date pre-populated and I want to allow the user to edit the date and then submit it to be recorded in an excel document.

 

Everytime I select a new date and update the form, it changes the date to a day prior.  After doing some research, I think it has something to do with UTC/Local date/time conversions, but I have been unable to get any of the workarounds to work.  I would be really grateful for any help you could provide. 

1 ACCEPTED SOLUTION

Accepted Solutions
lstod
Level: Powered On

Re: Date Picker Changes to Wrong Date

In case this helps anyone else....I was able to figure out the solution to the issue I was having.

 

When a User interacted with the Date picker in PowerApps it triggered an approval flow that updated dates in an excel spreadsheet. 

The flow converts all date/times to UTC and stored it in the spreadsheet with a timestamp of 0:00.

The data then flowed back to PowerApps where the Date Picker was set to use "local time", which for me subtracted 4 hours from the UTC date and caused the date to change to 1 day prior due to the time difference.

 

Solution: Set the Default of the Date DATA CARD (not the Default Date on the Date picker) to

DateAdd(Thisitem.'StartDate', 5, Hours)

View solution in original post

3 REPLIES 3
Dual Super User
Dual Super User

Re: Date Picker Changes to Wrong Date

Hi @lstod 

 

check this blog

https://toddbaginski.com/blog/working-with-local-and-utc-dates-and-times-in-powerapps/

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

lstod
Level: Powered On

Re: Date Picker Changes to Wrong Date

Thanks for your quick reply!  I'm still pretty new to powerapps and I read the link you provided.  I updated my date picker to be UTC format, but in the app  he used a label to display the "adjusted" date with the Text Parameter set as:

 

 DateAdd(UTCDatePicker.SelectedDate, TimeZoneOffset(UTCDatePicker.SelectedDate), Minutes)

 

I would like the adjusted date to be displayed in the date picker, which parameter would I do that under?  I tried DefaultDate, but that was not right.

lstod
Level: Powered On

Re: Date Picker Changes to Wrong Date

In case this helps anyone else....I was able to figure out the solution to the issue I was having.

 

When a User interacted with the Date picker in PowerApps it triggered an approval flow that updated dates in an excel spreadsheet. 

The flow converts all date/times to UTC and stored it in the spreadsheet with a timestamp of 0:00.

The data then flowed back to PowerApps where the Date Picker was set to use "local time", which for me subtracted 4 hours from the UTC date and caused the date to change to 1 day prior due to the time difference.

 

Solution: Set the Default of the Date DATA CARD (not the Default Date on the Date picker) to

DateAdd(Thisitem.'StartDate', 5, Hours)

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (3,980)