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

Community site session details

Session Id :
Power Apps - Error Handling
Answered

Date problem

(0) ShareShare
ReportReport
Posted on by 14
Hello, I am facing an issue with a gallery that displays a column containing dates. When I open the file in Excel, the date appears correctly. However, when the data is shown in the gallery, it seems to display one day earlier. Does anyone know why this might be happening? Any help or insights would be greatly appreciated.
 
       
I have the same question (0)
  • WarrenBelz Profile Picture
    151,627 Most Valuable Professional on at
    Date problem
    Hi @BP-06122300-0​​​​​​​
    Apart from Excel and Dates in Power Apps not being "good friends", I suspect this is a Time Zone issue, so firstly try
    DateAdd(
       ThisItem.YourDateField, 
       -TimeZoneOffset(), 
       Minutes
    )
     
    Please click 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 giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn    Buy me a coffee

  • BP-06122300-0 Profile Picture
    14 on at
    Date problem
    It doesn't work, it keeps showing a day early 
    When I try with a label it show me this

    It's like it's reading 3 hours early
  • BP-06122300-0 Profile Picture
    14 on at
    Date problem
    I tried it with positive TimeZoneOffset() and it works. Thanks!
     
    I have an issue with a button in my code. When it writes to the table, it adds the data to the next day instead of the current day. I believe the problem is related, but I'm not sure how to fix it
     
    Set(selectedYear; DropdownYear.Selected.Value);;
    Set(selectedMonth; DropdownMonth.Selected.Value);;
    Set(selectedDay; DropdownDay.Selected.Value);;
    Set(hoursValue; Input_Hours.Text);;
    Set(Activities; Input_Activity.Text);;
    
    Set(formattedDate;DateTimeValue(selectedDay & "/" & selectedMonth & "/" & selectedYear));;
    
    
    If(
        IsBlank(selectedYear) || IsBlank(selectedMonth) || IsBlank(selectedDay) || IsBlank(Activities) ||IsBlank(hoursValue);
        Notify("Please fill in all required fields before proceeding.";NotificationType.Error;5000);
        Switch(
            Input_User.Text;
            "bperez";
            If(
                IsBlank(
                    LookUp(
                        bperez;
                        DateValue(Text(Date)) = DateValue(Text(formattedDate));
                        Proposal
                    )
                );
                UpdateIf(
                    brunoperez;
                    DateValue(Text(Date)) = DateValue(Text(formattedDate));
                    {
                        Activity: Activities;
                        Hours: Value(hoursValue)
                    }
                )
            );
            "crivera";
            If(
                IsBlank(
                    LookUp(
                        crivera;
                        DateValue(Text(Date)) = DateValue(Text(formattedDate));
                        Proposal
                    )
                );
                UpdateIf(
                    conirivera;
                    DateValue(Text(Date)) = DateValue(Text(formattedDate));
                    {
                        Activity: Activities;
                        Hours: Value(hoursValue)
                    }
                )
            )
        )
    );;
    
     
  • WarrenBelz Profile Picture
    151,627 Most Valuable Professional on at
    Date problem
    Yes - same issue. Excel is problematic with dates as they can only be stored in Text (as in your case) or effectively a number. If you bring it all into SharePoint, all of this will go away as the Date field also allows for the Time Zone of the server and local device.
    You are going to need to add the TimeZoneOffset to every query reference of the data in your Table.
    Also (depending on where you are based), TimeZoneOffset is a negative value, so you should need to reverse it to add to the field value.
     
    Please click 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 giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn    Buy me a coffee

  • Verified answer
    WarrenBelz Profile Picture
    151,627 Most Valuable Professional on at
    Date problem
    A quick follow-up to see if you received the answer you were looking for or if you need further assistance.

    Please click 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 giving it a Like.
    MVP (Business Applications)    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 686 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 433 Super User 2025 Season 2

#3
wolenberg_ Profile Picture

wolenberg_ 266 Moderator

Last 30 days Overall leaderboard

Featured topics