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

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,426)