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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / date is different betw...
Power Apps
Answered

date is different between data source and date picker selected

(0) ShareShare
ReportReport
Posted on by 6

Hello 

 

i am building an app to record information, my date picker default is Today(),  but after saved, the date is minus 1 day compare today() in my data source (excel file). but when i display the record in gallery, the date is my submit date.

 

for example: ID 197 and 198, date is 5/11/2020 12:00 AM in Gallery shown, but the date is 5/10/2020 16:00 in data source.

could someone help me solve this issue?

GalleryGallerydatasourcedatasource

Gallery.jpg
datasource.jpg
Categories:
I have the same question (0)
  • KrishnaV Profile Picture
    5,023 on at

    Hi @Bruce_Fei ,

     

    Could you explain how are you are saving your data and what is the back end (sharepoint list, SQL / Excel?). That will give us little more clue to help you.

     

    Regards,

    Krishna

  • Bruce_Fei Profile Picture
    6 on at

     

    Hi, @KrishnaV 

    I using excel file for my data source and stored in one drive. first screen is new record screen, second is my save code, i am using collect function. and date time zone is Local for date picker.

    New Record.JPGCode.JPG

  • KrishnaV Profile Picture
    5,023 on at

    Ok this I can see the locatime and date issue. Is your PowerApps environement is local to you? if not this is expected. Try this DateAdd(InputDate.Selected,TimeZoneOffset(),Minutes) this will convert the date & time with respect to your calendar.

     

    Follow the below article from MS:
    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-dateadd-datediff

     

    Note: If this helps mark it as the solution.

     

    Regards,

    Krishna

  • Bruce_Fei Profile Picture
    6 on at

    Hi, @KrishnaV 

    i try code "Date:DateAdd(InputDate.SelectedDate,TimeZoneOffset(),Minutes)", now the date shown are same day between gallery list and data source, but different time.

    but the day of date is still not my timezone. my time is 5/11/2020 3:00 PM.  how to adjust this code?

    Gallery1.jpgdatasource1.jpg

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Bruce_Fei ,

    Based on the issue that you mentioned, I think this issue is related to Time Zone. Based on the issue that you mentioned, I have made a test, and the issue is confirmed on my side.

     

    When saving date time value back to Excel table from canvas app, it would convert the submitted date time value from canvas app into UTC format, then save the UTC format date time value back to Excel Table.

     

    I have made a test on my side, please consider take a try with the following workaround:

    12.JPG

     

    13.JPG

    Within the Edit form, set the Update property of the Date time field data card to following:

    DateAdd(DateValue1.SelectedDate + Time(Value(HourValue1.Selected.Value), Value(MinuteValue1.Selected.Value), 0), -TimeZoneOffset(DateValue1.SelectedDate + Time(Value(HourValue1.Selected.Value), Value(MinuteValue1.Selected.Value), 0)), Minutes)

    set the Default Property of the Date Time field data card to following:

    DateAdd(ThisItem.'Due Date', TimeZoneOffset(), Minutes)

     

    If you want to reference the stored Date time value from your Excel table in Gallery, please use the following formula:

    13.JPG

    Set the Text property of the Label to following:

    DateAdd(ThisItem.'Due Date', TimeZoneOffset(), Minutes)

     

    Within your Detail Form, set the Default property of the Date time field data card to following:

    DateAdd(ThisItem.'Due Date', TimeZoneOffset(), Minutes)

     

    Please consider take a try with above solution, check if the issue is solved.

     

    Best regards,

  • KrishnaV Profile Picture
    5,023 on at

    Hi @Bruce_Fei,

     

    @v-xida-msft has explained with an example on the same function which I have proposed to you and I was also able to achieve the same.

    Please let us know if you still experience any issue.

     

    Note: If my proposal/advice helps, please mark it as the solution.

     

    Regards,

    Krishna

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Bruce_Fei ,

    Have you taken a try with the solution I provided above?

     

    Based on the issue that you mentioned, I think above solution I provided could achieve your needs. Please take a try with it, check if the issue is solved.

     

    If you have solved your problem, please consider go ahead to click "Accept as Solution" to identify this thread has been solved.

     

    Best regards,

  • Shreyansh Profile Picture
    6 on at

    Hi @v-xida-msft 

     

    I had same problem, i tried your solution, but it gave me error, when implementing code in "Update" in this piece of code - 

     

    DateAdd(DateValue1.SelectedDate + Time(Value(HourValue1.Selected.Value), Value(MinuteValue1.Selected.Value), 0), -TimeZoneOffset(DateValue1.SelectedDate + Time(Value(HourValue1.Selected.Value), Value(MinuteValue1.Selected.Value), 0)), Minutes)

     

     

    The error i got: expected a valid date value as a parameter to 'timezoneoffset' powerapps, recieved value: null

     

    Any idea on this.

     

    Thanks in Advance,

    Shreyansh Parihar

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Shreyansh ,

    Please set default value within your DateValue1 (DatePicker control). Set the DefaultDate property of the DateValue1 to following:

    Today()

    then try above formula again, check if the issue is solved.

     

    @Bruce_Fei have you taken a try with the solution I provided above? Is it helpful in your scenario?

     

    Best regards,

  • Shreyansh Profile Picture
    6 on at

    Hi @v-xida-msft ,

     

    Thank you for the change, it finally worked, all the date in my Excel and Displayed date are correct.

    But can you tell me why Parent.Default() caused that error, while Today() didn't.

     

    Thanks Once again.

     

    Best Regards,

    Shreyansh

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard