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 / Hour Value dropdown li...
Power Apps
Unanswered

Hour Value dropdown list's value is 1 hour off on SharePoint List because of daylight savings

(0) ShareShare
ReportReport
Posted on by 45

Hi folks!

I am trying to fix the time difference because of daylight savings and could use some help.

 

I am using Power apps integrated with a SharePoint List to allow contractors to record the clock-in/out.

mmtd_0-1681487406844.png

There are columns for the expected time for arrival and departure times on the SP List. Arrival and departure times default to the expected time respectively. So, a contractor would just submit the form without changing anything if they start and end as scheduled.

But I noticed that the arrival and departure times get off by one hour when it's recorded on the SharePoint List side, and I am supposing it is because of spring forward.

I have confirmed that both SharePoint and Power Apps' local time settings are set to my local (UTC -7, Mountain Time).

 

To submit the form, I use a button with onSelect = SubmitForm(TimeCardForm).

 

I have checked forum topics to fix this, but those are for date pickers rather than a dropdown list for hour values like my app has, so the codes and properties are not applicable to my case it doesn't seem (I honestly don't know where to put those codes in as the hour values are just a string that's in a dropdown list and do not really support DateAdd people usually suggest).

 

I would really appreciate any advice!

Categories:
  • extensol Profile Picture
    20 on at

    I havn't tried yet, but on top of my head, I would suggest to use Patch function and use LocalTime function with time.

  • mmtd Profile Picture
    45 on at

    Hi, thank you for your response!

     

    It doesn't seem like there is a LocalTime function in Power Apps 😞

    But I found the TimeZoneOffset function instead! Which did not work either though...

    I have tried Patch as well, but it requires the Title, and including it ends up creating a new record on the List instead of updating the right record (besides, the Titles in my List aren't unique). I have also tried to specify the ID, but since it's a read-only column it didn't work.

     

    mmtd_1-1681495773762.png

     

    Am I doing the Patch wrong?

  • extensol Profile Picture
    20 on at

    Modify or create a record in a data source

    Patch( DataSource, BaseRecord, ChangeRecord1 [, ChangeRecord2, … ])

    • DataSource – Required. The data source that contains the record that you want to modify or will contain the record that you want to create.
    • BaseRecord – Required. The record to modify or create. If the record came from a data source, the record is found and modified. If the result of Defaults is used, a record is created.
    • ChangeRecord(s) – Required. One or more records that contain properties to modify in the BaseRecord. Change records are processed in order from the beginning of the argument list to the end, with later property values overriding earlier ones.

    If you go for Defaults, it will create a new record.

     

     

    Also for the TimeZoneOffset function, you need to put date/time within the function. TimeZoneOffset(date/time valse)

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @mmtd,

    Have you solved your problem?

    Actually, it is a daylight saving issue, to overcome this, you just need to modify your Update property for each date time field as below:

    DateAdd( DateValue1.SelectedDate + Time(Value(HourValue1.Selected.Value), Value(MinuteValue1.Selected.Value), 0),-TimeZoneOffset(),Minutes)
  • mmtd Profile Picture
    45 on at

    Hello both,

    I appreciate your replies.

     

    I changed my Patch function to update a record, and a simple test where I changed a string column was successful! Thank you for your advice, now I know how to update records.

    But when I try to update the date and time, I get the error message "The value [the number input in the Hour/Minute dropdown list] cannot be converted to a date or time value." and cannot update the record.

     

    Also, I have tried

    DateAdd( DateValue1.SelectedDate + Time(Value(HourValue1.Selected.Value), Value(MinuteValue1.Selected.Value), 0),-TimeZoneOffset(),Minutes)

    and 

    DateAdd( DateValue1.SelectedDate + Time(Value(HourValue1.Selected.Value), Value(MinuteValue1.Selected.Value), 0),-TimeZoneOffset(DateValue1.SelectedDate + Time(Value(HourValue1.Selected.Value), Value(MinuteValue1.Selected.Value), 0)),Minutes)

    in the Update property of the data time field but both are 5 hours and 4 hours off respectively.

     

    I would be grateful for any further advice. Thank you!

  • extensol Profile Picture
    20 on at

    You try using Text function...

    Text(data, "dd")

     

    d or dd for Day

    m or mm for Month

    yy or yyyy for year

    hh for hour

    mm for minute (when using with hour like hh:mm)

  • mmtd Profile Picture
    45 on at

    I am sorry for the late reply.

     

    Would you explain more please? Do I change the Arrival Time column from date type to string and Patch the submission as text?

     

    Thanks!

  • extensol Profile Picture
    20 on at

    To avoid receiving error: "The value [the number input in the Hour/Minute dropdown list] cannot be converted to a date or time value."

    I assume the data type of column is date/time and hence you may need to convert the combobox value to time format. Text function can let you convert the values to date/time format.

  • mmtd Profile Picture
    45 on at

    Thank you so much for being so prompt!

     

    I did this:

    Patch(
     'Meeting Log',
     LookUp('Meeting Log','ID' = ID_DataCard2.Default), 
     {
     'Arrival Time': DateValue1_1.SelectedDate+Text(Time(
     Value(DateAdd( HourValue1_1.Selected.Value, TimeZoneOffset(), TimeUnit.Hours )),
     Value(DateAdd( MinuteValue1_1.Selected.Value, TimeZoneOffset(), TimeUnit.Minutes )),
     0
     ),"hh:MM")
    ,
     'Departure Time': DateValue2_1.SelectedDate+Text(Time(
     Value(DateAdd( HourValue2_1.Selected.Value, TimeZoneOffset(), TimeUnit.Hours )),
     Value(DateAdd( MinuteValue2_1.Selected.Value, TimeZoneOffset(), TimeUnit.Minutes )),
     0
     ),"hh:MM")
     }
    )

     

    But I am getting the same error. When I tried to also wrap the date with the Text function, it complained that it was expecting a date but got a text.

     

    Any advice?

  • pjohn79 Profile Picture
    4 on at

    Did you find a solution for this? If so could you explain what you did? I am in the same boat.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard