cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TheRydad
Advocate I
Advocate I

Date displayed is one day off

I must be doing something stupidly dumb here, and I am hoping someone can nudme me in the right direction.

 

I have an Excel file with a table that includes a date field. In my "edit" form, I am using a DatePicker control wired to the "Date" field in the table. I can input a new record or update an existing one with no problems and the selected date gets into the table correctly. The problem is that when I view the records in a Gallery or otherwise pull the record up later, the date is early by one day.

 

If I display the date in a text control, it is formatted like this: "2016-05-12T00:00:00Z". The DatePicker control will, in this example, be displaying "5/11/2016". The record in the Excel table is "5/12/2016". I suspect the issue is with a time zone conversion. In fact, if I manually change the record in the Excel table to "5/12/2016 08:30", that record then displays as expected. I am in the US central time zone.

 

Has anyone encountered this before? If so, did you engineer any kind of "solution"?

 

I am probably going to whip up a formula to add the hour and minute to the field using Now() and Text(), but would love to hear anyone's thoughts.

 

Note- recording the time is not really essential for my purposes, but it wouldn't hurt to have it. I am also thinking of adding drop down controls for selecting the time (this is meant to be a mobile app, so trying to avoid a lot of text entry).

 

Thanks!

 

-rd

20 REPLIES 20
Anonymous
Not applicable

Here is a solution which is working for me :

 

I use an Excel database, with a date column, and a form. where user can interact with.

 

To write date in my database (excel sheet), from my Powerapps application, i use -TimeZone :

 

DateAdd(

     MyDatePicker.SelectedDate ;

     -TimeZoneOffset() ;

     Minutes

)

 

Then, i send the result to my database.

 

To write date in my powerapp application from my database (excel sheet), i use same with +TimeZone :

 

DateAdd(

     LookUp(

            MyExcelSheetTable;

            [conditions];

            MyDateColumnInMyExcelSheetTable

     );

     TimeZoneOffset() ;

     Minutes

)

 

 

 

This is working well for me, and i haven't any date problem. Try it too.
You can refer to this page for more details : 

DateAdd, DateDiff, and TimeZoneOffset functions in Power Apps - Power Apps | Microsoft Docs

 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (1,615)