cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
PhilD
Level 8

Daylight savings time problem - one hour off

 

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

DaylightSavingsTime.png

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Daylight savings time problem - one hour off

@PhilD 

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!

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

4 REPLIES 4
Super User
Super User

Re: Daylight savings time problem - one hour off

@PhilD 

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!

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

PhilD
Level 8

Re: Daylight savings time problem - one hour off

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
        )
)
Super User
Super User

Re: Daylight savings time problem - one hour off

@PhilD 

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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
PhilD
Level 8

Re: Daylight savings time problem - one hour off

Yes, you are right. This is actually more precisely what I wanted all along.

 

Thanks again for helping me understand why this happened.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,378)