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 / DatePicker is one day off
Power Apps
Answered

DatePicker is one day off

(0) ShareShare
ReportReport
Posted on by 905

Dear Colleagues,

 

In my gallery is use two DatePickers with the help of this function:

 

Sort(Filter(Search(IdeaBox_1;SearchBox.Text;"Nazwa";"Opis"); Utworzony >= DatePicker1.SelectedDate &&
Utworzony <= DatePicker2.SelectedDate); Utworzony; If(SortDescending2;Descending;Ascending))

 

DatePicker1 is a date FROM DatePicket2 is a date TO.

So i can filter using them different date ranges.

 

In DatePicker1 default value I set Blank(). This is great because it is setting the date as 31.12.2001.

In DatePicker2 default value I set Today()

 

Now when I open my gallery. It shows data one day behind. For example if Today() is 23.09.2020 - my gallery will show date up to 22.09.2020. When I change Today() to 24.09.2020 it will show the data from 23.09.2020.

 

I found this topic:

https://powerusers.microsoft.com/t5/Building-Power-Apps/Datepicker-returns-minus-1-day/td-p/3807/pag...

 

and followed this advice:

 

Hi, I encountered this too when my datepicker is set to UTC. OnVisible, it is set to 'TODAY', but it will always return the current date minus 1. So here is the workaround that I did, I set the default value of the datepicker to 'SelectedEventDate' and placed the code below on the OnVisible property of the screen:

 

UpdateContext({SelectedEventDate: DateValue(Text(Today(),DateTimeFormat.UTC))+1 })

 

but it works partially - it is by default setting a DatePicker2 one day ahead. So with this function Today() is 24.09.2020. It shows all records but if user change DatePicker to 23.09.2020 it will be once again missing some data.

 

Using DatePickers like that will be really confusing. My users will have to be aware that the filter is one day off.

Is there any workaround?

 

Please kindly advise if there is any solution.

 

Utworzony is a CreatedBy from Sharepoint list:

 

Elitezone_0-1600845488243.png

 

 

Categories:
I have the same question (0)
  • Vijay Tailor Profile Picture
    2,961 on at

    Hi,

    you can use Like that.

    In DatePicker Set the Defaultdate is Today().

    and 
    here you can use like below.

     

    UpdateContext({SelectedEventDate: DateValue(Text(DatePickerName.Selected,DateTimeFormat.UTC))+1 })

     

     See the Test Reference.

    VijayTailor_0-1600897429904.png

    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

     

  • Elitezone Profile Picture
    905 on at

    It is still one day off. This solution does not help at all.

    Does anyone have idea if this can be fixed?

     

    If it is bug or cannot be fixed I must say delete all those filters as soon as possible.

  • Elitezone Profile Picture
    905 on at

    Does anyone have idea what to do?

    My users are very confused when I tell them to set datepicker to tommorow date to view today results...

    😞

  • Vijay Tailor Profile Picture
    2,961 on at

    Can you check the below Yellow highlighted Properties?

    YOu can select the UTC , then Hope your issue is resolved.

    VijayTailor_0-1601280477619.png


    Thanks,

    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Elitezone Profile Picture
    905 on at

    When I select UTC it does show today in datepicker date, but my gallery record from today is not visible.

    This changed nothing.

  • Vijay Tailor Profile Picture
    2,961 on at

    it Shows,

    See As per my TimeZone Today Date is 28 Sep

    and When I am using Utc Time Zone in Datepicket and Use Today() function then it's showing me UTC Date Perfectly. (27 Sep).

    reference below Screen Shot.

    VijayTailor_0-1601281218767.png

    Thanks

  • Verified answer
    Elitezone Profile Picture
    905 on at

    Today() both on UTC and local shows OK.

    The date that is provided is perfect (local = today idea time), but when this date is picked gallery does not filter correctly - it shows records one day behind.

     

    I made a better workaround:

     

    Sort(
     Filter(
     Search(IdeaBox_1;SearchBox_Priv.Text;"Nazwa";"Opis");(Utworzony) >= DatePicker1_1.SelectedDate && (Utworzony) <= DatePicker2_1.SelectedDate +1;
     'Utworzone przez'.Email=gblUserEmail
     );
     Utworzony;If(SortDescending2;Descending;Ascending))

     

    I added +1 to DatePicker2_1.Selected Value

     

    and now it shows perfectly...

    Dunno if this will work like that all the time but right now when DatePicker is set on Today() it shows 28.09.2020 and gallery shows results one day ahead.

     

    This is a workaround, but i still believe that it is a bug.

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard