I have a form with a DataCard connected to a SharePoint list with a date time column. I was having some problems with the date/time being stored, I thought it was time zone related at first. However, I found that the value in the DateValue control SelectedDate also contains the time by creating a label with this formula:
This is a problem because the standard (locked) update formula is this:
DateValue8.SelectedDate + Time(Value(HourValue8.Selected.Value), Value(MinuteValue8.Selected.Value), 0)
This means the time is added on twice! Has anyone else seen this behaviour?
I guess I should put in my work around - I set the DefaultDate in the Date Picker to this to remove the time part:
DateValue(Text(Parent.Default, ShortDate, "en-UK"), "en-UK")
I was having a similar problem with storing incorrect DateTime values and having it not be a timezone issue.
Microsoft Tech's solution? Remake it until it's no longer an issue .....
This was in a fresh test app I made just to show this problem 😕
I also tested it with a date picker not in a form and it didn't seem to have the same issue, might be some kind of type coercion problem as it gets its value through the parent data card rather than directly from the data source.
Same here when I did some digging. The Date Picker was fine and dandy working on its own, however, once I insterted in into a Form times became incosistent.
It shows the correct time in the App, even the Form Updates are showing the correct time, however it's still sending my SQL Database inconsistent times that vary wildly from the actual time that it is.
Thing is, it's only one of my apps that this has been an issue for. Other apps I've been developing haven't run into this problem with Form Times sending data to my Database ... at least not yet.
If you still have the app try putting in a couple of labels set to this - obviously put the appropriate control names in!
Text(DateValue8.SelectedDate, ShortDateTime24) Text(Date1_DataCard2.Update, ShortDateTime24)
The first one will tell you if the date picker is incorrectly storing the time, if it's OK it will show midnight. The second shows what will be sent to the database.
Ahhhh my man.
Here is my date card with this morning's date selected : 11/21/2018 07:16
And here would be the couple of labels you mentioned (First label on Left, second label on Right). It's picking Non-Midnight as the Date value when, as you stated, it should be picking up Midnight and then adding the 07:16 onto 00:00 in the Update.
Note : The first time I loaded up the app, the first label was picking up the correct Midnight Date value : 11/21/2017 00:00 and Updating the correct DateTime : 11/21/2018 07:16
After reloading the app to try it again, I ran into that 07:16 -> 14:32 issue
Also ... just noticed you were the one who linked me here from my previous thread ... my bad
Yeah, I admit I was fishing for an ally on this! Good to see it reproduced. It's the same here, it's OK when the screen first comes up but as soon as you set the selected item in the form it goes wrong - even if it's the same record.
Any idea how to get the attention of someone who can fix it?
In theory a Microsoft Tech should eventually see this? I tried reporting this as a bug as you already saw and they kind of wrote me off, so hopefully someone sees this soon!
Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.
Check out the winners of the recent 'Can You Solve These?' community challenge!
Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.
Featuring samples like Return to the Workplace and Emergency Response Applications
Features releasing from October 2020 through March 2021