web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Ensuring correct time ...
Power Apps
Answered

Ensuring correct time is saved in a SharePoint list (Referring to Day time savings in UK)

(0) ShareShare
ReportReport
Posted on by 1,176
Hi,

I'm sure this could be a common issue?

I have a Powerapp that user a required to select a date and time to retrieve CCTC footage

I've had recent queries advising that some of the times are being saved an hour out, in the SharePoint list and noted on a subsequent email.

How can i ensure that the correct time is saved throughout the year if the time in October goes back and hour and later the following year, march time the hour is gained again.

This is my current formula.  At the moment the time's are correct.  But if any CCTV footage is requested prior to 26/10 then the times are an hour out which can cause issues with retrieving the correct footage.

Hopefully there is a formula which will cater for both scenario's??  

Categories:
I have the same question (0)
  • Suggested answer
    MMcCloud Profile Picture
    393 Moderator on at
    Good Afternoon Friend,
     
    Your problem is the way you are calculating for the offset. TimeZoneOffset() the function returns minutes replace it with something that creates an invalid value wrap the TimeZoneOffset() function in a DateAdd() function to make the combination work. The rest of the logic should work.
     
     
    Generated logic:
    DateAdd(
        DateValue(StartDate_DP.SelectedDate) +
        Time(Value(HourValue1.Selected.Value), Value(MinuteValue1.Selected.Value), 0),
        -TimeZoneOffset(DateValue(StartDate_DP.SelectedDate)),
        Minutes
    )
     
    If this answers your question please select it as the answer if not please feel free to follow up and I will attempt to continue assisting.
     
    Have a good day!
  • WarrenBelz Profile Picture
    155,352 Most Valuable Professional on at
    I will give you an alternative as the TimeZoneOffset may not do what you want here. This needs to be changed every year (although you could have a reference collection for a number of years ahead), but start with this
    With(
       {
         _DLS: 
         If(
             StartDate_DP.SelectedDate >= Date(2025, 10, 26) &&
             StartDate_DP.SelectedDate <= Date(2026, 3, 29),
             -60,
             0
         )
       },
       If(
          !IsBlank(StartDate_DP.SelectedDate),
          DateAdd(
             StartDate_DP.SelectedDate + 
             Time(
                Value(HourValue1.Selected.Value),
                Value(MinuteValue1.Selected.Value),
                0
             ),
             _DLS,
             TimeUnit.Minutes
          )
       )
    )
     
    Please Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like
    Visit my blog
    Practical Power Apps    LinkedIn  
  • Chris1968 Profile Picture
    1,176 on at
    Hi,

    Thank you both for your suggestions..

    I also have a Finish Date time which I assume, I just amended the reference for the StartDate (StartDate_DP)
    to the Finish Date (FinishDate_DrpDwn).

    Just to make it a bit more robust, if that is the correct terminology, the change occurs at specific times.. 

    1 hour forward at 1am on the last Sunday in March and 1 hour back at 2am on the last Sunday in October.
    Can this be calculated within any of these suggestions.

    I can refence the dates or add to my calendar to update manually..

    Regards

    Chris


     
  • Suggested answer
    WarrenBelz Profile Picture
    155,352 Most Valuable Professional on at
    If you really want to find those times on the first Sundays in October and March dynamically, you can as below
    If(
       !IsBlank(StartDate_DP.SelectedDate),
       With(
          {
             _Mar: 
             LookUp(
                Sort(
                   ForAll(
                      Sequence(31),
                      Date(
                         Year(StartDate_DP.SelectedDate),
                         3,
                         Value
                      ) + Time(1, 0, 0)
                   ),
                   Value,
                   SortOrder.Descending
                ),
                Weekday(Value) = 1
             ).Value,
             _Oct: 
             LookUp(
                Sort(
                   ForAll(
                      Sequence(31),
                      Date(
                         Year(StartDate_DP.SelectedDate),
                         10,
                         Value
                      ) + Time(2, 0, 0)
                   ),
                   Value,
                   SortOrder.Descending
                ),
                Weekday(Value) = 1
             ).Value,
             _DateTime: 
             StartDate_DP.SelectedDate + 
             Time(
                Value(HourValue1.Selected.Value),
                Value(MinuteValue1.Selected.Value),
                0
             )
          },
          DateAdd(
             _DateTime,
             If(
                _DateTime >= _Mar && _DateTime <= _Oct,
                -60,
                0,
                TimeUnit.Minutes
             )
          )
       )
    )
    
    
    However using two dates raises a lot of complications - what happens when one is outside the period and one inside ?
     
    Please Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like
    Visit my blog
    Practical Power Apps    LinkedIn  
  • WarrenBelz Profile Picture
    155,352 Most Valuable Professional on at
    A quick follow-up to see if you received the answer you were looking for. Happy to assist further if not.
     
    Please Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like ♥
    Visit my blog
    Practical Power Apps    LinkedIn   
  • Chris1968 Profile Picture
    1,176 on at
    Hi @WarrenBelz

    I've been doing some testing using your first formula.  

    I only applied the Formula for the Start Date only.  
    Date prior to BST


    SP list shows correct time for both


    After the clocks changed

    SP list shows an hour difference
  • WarrenBelz Profile Picture
    155,352 Most Valuable Professional on at
    Hi @Chris1968,
    I cannot see your app or fully understand what how/you are trying to query, but the code I posted does the following:-
    1. Calculates the date/time for 1AM on the last Sunday in March of the year selected
    2. Calculates the date/time for 2AM on the last Sunday in October of the year selected
    3. If the date/time selected is between those date/times, deducts an hour from it
    You have not posted the formula for the query using this value, so I am not sure how you are then using it.
  • Verified answer
    WarrenBelz Profile Picture
    155,352 Most Valuable Professional on at
    A quick follow-up to see if you received the answer you were looking for. Happy to assist further if not.
     
    Please Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like ♥
    Visit my blog
    Practical Power Apps    LinkedIn   

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 875

#2
Valantis Profile Picture

Valantis 530

#3
11manish Profile Picture

11manish 432

Last 30 days Overall leaderboard