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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Powerapp Daylight savi...
Power Apps
Unanswered

Powerapp Daylight savings time issue

(0) ShareShare
ReportReport
Posted on by 70

Wondering what other peoples solutions are for this oddity in Powerapps.

Say you have a date picker and your own sudo time picker, you then write a function to marry the two into a date time value and use it in your app.

This is all well and good most of the year except if you live in a country with daylight savings - even though you're using the date value for its day/month/year values and nothing more - it still seems to in the back end involve the time, so even if you apply your own time value using the "DateTimeValue" function it'll still add its own time value into the calculation meaning now your inputs are an hour off - this problem only exists for two days of the year and behaves as desired the rest of it.

Before anyone suggests it, the "TimeZoneOffset" function is no help in this situation unless you can build a check that can tell it's a daylight savings day vs a normal day 363 days of the year.

I'll give some examples to get my point across below - yesterday (7/4/24) was a daylight savings day.

 

ShannonC_0-1712549584106.png - Good

ShannonC_1-1712549615866.png - Bad

ShannonC_2-1712549646229.png - Normal day - everything back to normal


Here are my below attempts to rip out the undesired time correction attempt:

 

 

//Value(Text(DateValue(PickRDay_1.SelectedDate)+Time(TimePick_1.SelectedText.Value,0,0),"yymmddHHmm"))
//Text(DateAdd(PickRDay.SelectedDate,-TimeZoneOffset(PickRDay.SelectedDate),TimeUnit.Milliseconds),"yymmddHHmm")
//Text(DateAdd(PickRDay.SelectedDate+Time(TimePick.SelectedText.Value,0,0),TimeZoneOffset(),TimeUnit.Minutes),"yymmddHHmm")
//DateAdd(PickRDay.SelectedDate+Time(TimePick.SelectedText.Value,0,0),TimeZoneOffset(PickRDay.SelectedDate+Time(TimePick.SelectedText.Value,0,0)))
Value(Text(DateTimeValue(DateValue(PickRDay_1.SelectedDate)+Time(TimePick_1.SelectedText.Value,0,0)),"yymmddHHmm"))

 

 

(Side rant, please add an actual time picker and a datetime picker Microsoft - I've seen this asked for since 2017, if you've had time to add new versions of existing inputs, you've got time to add those)

Categories:
I have the same question (0)
  • Verified answer
    ShannonC Profile Picture
    70 on at

    For anyone that finds them selves on this page - through MS support I got the answer:
    For text values - split then merge the date and time values as seen below:

    Text(DateTimeValue(
     DateValue(DatePicker1.SelectedDate)
    ),"yymmdd")
    &
    Text(TimeValue(Time(Dropdown1.SelectedText.Value,0,0)),"HHmm")

    For DateTime Values - use:

    DateTimeValue(
     DateValue(Date.SelectedDate) & " " & TimeValue(
     Time(
     Hour.SelectedText.Value,
     Minute.SelectedText.Value,
     0
     )
     )
    )

     

  • HV-27030953-0 Profile Picture
    4 on at
    I have this issue as well.
     
    My current solution is to create two variables one for the last Sunday of March and one for the last Sunday of October.
     
    Then use the variables in a formula so if the given date is between the two variables add one day. 
     
    I have not yet tested if this works after the clocks change at the end of March, also this method only fixes the days after the first Monday, this does not matter for my use case as I am only interested in Thursdays but if anyone try's this and fixes it please let me know. I will update my response when i find out if it works post clock change.
     
    Screen On Visible
    Set(
        LastSundayMarch,
        With(
            {LastDay: DateValue(Text(Date(2025, 4, 1) - 1, "yyyy-mm-dd"))},
            LastDay - Weekday(LastDay, StartOfWeek.Monday)
        )
    );
    
    Set(
        LastSundayOctober,
        With(
            {LastDay: DateValue(Text(Date(2025, 10, 1) - 1, "yyyy-mm-dd"))},
            LastDay - Weekday(LastDay, StartOfWeek.Monday)
        )
    );
     
     
     
    Text Label
    If(Date2.SelectedDate > LastSundayMarch && Date2.SelectedDate < LastSundayOctober, Date2.SelectedDate +1, Date2.SelectedDate)
     
  • Suggested answer
    CarlosFigueira Profile Picture
    on at
    If we do something like Date(2025,3,9) + Time(10,0,0) in the United States (where DST starts on March 9th this year), the result will be 11am on March 9th. This is technically correct - that operation is adding 10 hours to midnight on 2025-03-09, which, due to the time change, is indeed 11am.
     
    If you want the exact time, without accounting for any DST changes, you can use an expression like the following:
     
    DateTime(
      Year(DatePicker1.SelectedDate),
      Month(DatePicker1.SelectedDate),
      Day(DatePicker1.SelectedDate),
      Value(Dropdown1.SelectedText.Value),
      0,
      0
    )

    By taking the component parts of the date and time values, and using the DateTime value, you can create a value with exactly the component values you need.

    Hope this helps!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard