cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Bug: Possible cause of mystery date problems: Time not midnight in DataCard DatePicker.SelectedDate

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:

Text(DateValue8.SelectedDate, ShortDateTime24)

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?

20 REPLIES 20
Highlighted
Helper I
Helper I

Re: DataCard - Time is not midnight in DateValue.SelectedDate

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")
Highlighted
Helper I
Helper I

Re: Possible cause of mystery date problems: Time is not midnight in DataCard DatePicker.SelectedDat

Quick runthrough of the problemQuick runthrough of the problem

Highlighted

Re: Possible cause of mystery date problems: Time is not midnight in DataCard DatePicker.SelectedDat

I was having a similar problem with storing incorrect DateTime values and having it not be a timezone issue.

 

https://powerusers.microsoft.com/t5/General-Discussion/Now-Bug-in-Online-Developer/m-p/182621#M60223

 

Microsoft Tech's solution? Remake it until it's no longer an issue .....

Highlighted
Helper I
Helper I

Re: Possible cause of mystery date problems: Time is not midnight in DataCard DatePicker.SelectedDat

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.

Highlighted

Re: Possible cause of mystery date problems: Time is not midnight in DataCard DatePicker.SelectedDat

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.

Highlighted
Helper I
Helper I

Re: Possible cause of mystery date problems: Time is not midnight in DataCard DatePicker.SelectedDat

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.

Highlighted

Re: Possible cause of mystery date problems: Time is not midnight in DataCard DatePicker.SelectedDat

Ahhhh my man.

 

Here is my date card with this morning's date selected : 11/21/2018 07:16

 

cap1.PNG

 

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.

 

cap2.PNG

 

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 Smiley Wink

Highlighted
Helper I
Helper I

Re: Possible cause of mystery date problems: Time is not midnight in DataCard DatePicker.SelectedDat

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?

Highlighted

Re: Possible cause of mystery date problems: Time is not midnight in DataCard DatePicker.SelectedDat

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!

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (3,493)