I have a PowerApps form that sets the date and time for a SharePoint list item. The update property for the data card is shown below, referencing the three controls on the card.
Until today, this had been working fine for thousands of items entered but since daylight savings time (I'm in Eastern Standard time zone), this method of combining the date, hour & minute results in a time that is one hour ahead of the correct time.
//update property of datacard
DateValue3_1.SelectedDate + Time( Value(HourValue3_1.Selected.Value), Value(MinuteValue3_1.Selected.Value), 0 )
For example, the user enters 3/10/20019 08:44 as shown below and the SharePoint list item is updated to 3/10/20019 09:44
Solved! Go to Solution.
Your results are actually correct based on your formula.
If you add 8:44 to 12:00 on 3/10/2019 you will get 9:44. Because the time changed, there is 1 hour lost.
If you add 1 hour to 12:00 on 3/10/2019 you get 1:00 AM
If you add 2 hours to 12:00 on 3/10/2019 you get 3:00 AM (time change at 2:00 AM)
If you were to add 8:44 to 2:00 on 3/10/2019, you would get 10:44 because it is after the time change at 2:00 AM (no hour lost).
I hope this sheds some light for you...just in time!
Your results are actually correct based on your formula.
If you add 8:44 to 12:00 on 3/10/2019 you will get 9:44. Because the time changed, there is 1 hour lost.
If you add 1 hour to 12:00 on 3/10/2019 you get 1:00 AM
If you add 2 hours to 12:00 on 3/10/2019 you get 3:00 AM (time change at 2:00 AM)
If you were to add 8:44 to 2:00 on 3/10/2019, you would get 10:44 because it is after the time change at 2:00 AM (no hour lost).
I hope this sheds some light for you...just in time!
Very good, thank you for this answer! I hadn't properly considered that the 12:00 part of the date was actually denoting a time prior to the time change.
Before reading this, I rushed out a fix using the code below which is working fine (for reasons related to your answer I suppose). This builds and populates a proper date time value in the SharePoint list column. Let me know if you think there are any other implications of using this...
DateTimeValue( DateValue3_1.SelectedDate & " " & Time( Value(HourValue3_1.Selected.Value), Value(MinuteValue3_1.Selected.Value), 0 ) )
Yes, that should work for you because there, you are building the date/time as a string rather than calculating it. Then, obviously, converting it to a value. Which is, I believe, what you really wanted to begin with - actual 8:44 rather than 12:00 + 8:44.
Yes, you are right. This is actually more precisely what I wanted all along.
Thanks again for helping me understand why this happened.
User | Count |
---|---|
198 | |
122 | |
85 | |
50 | |
42 |
User | Count |
---|---|
284 | |
159 | |
134 | |
73 | |
72 |