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?
Gallery
datasource
Hello, can you help on if the date picker only for the date (no time included)? Thanks
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
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,
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
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,
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
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:
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:
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,
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?
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
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.
WarrenBelz
146,651
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional