cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Kudo Kingpin
Kudo Kingpin

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
Highlighted
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
Highlighted
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

Highlighted
Kudo Kingpin
Kudo Kingpin

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
        )
)
Highlighted
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.
Highlighted
Kudo Kingpin
Kudo Kingpin

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
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

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

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,948)