cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

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
Highlighted
Frequent Visitor

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
Highlighted
Dual Super User II
Dual Super User II

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.

Highlighted

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.

Highlighted
Frequent Visitor

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (8,666)