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.
Solved! Go to Solution.
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)
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.
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.
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)
User | Count |
---|---|
139 | |
132 | |
79 | |
74 | |
74 |
User | Count |
---|---|
207 | |
196 | |
70 | |
62 | |
55 |