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

Date formatting adding time

Hello,

 

I have a form that a user will fill out and select a date where they believe the job will be completed. This is done through a Date Picker in a form. The data from the form is than written to an excel document on stored in OneDrive. The date rights to the excel document perfectly except for the fact of it adds a time to the end of the date which I don't want and throws off some of my if checks I use later. I have the Date picker format set to DateTimeFormat.ShortDate which I believe shouldn't include the time. What am I missing here? Any help is appreciated.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Microsoft
Microsoft

Re: Date formatting adding time

Hi zblankenship,

 

Maybe check the Update property of the card housing the datepicker in the form - usually PowerApps detects the date format from the source and puts the datepicker constructs into the form for you - but these tend to include minutes and seconds, which you don't need.  It then constructs a datetime format from all three dropdowns used to collect date and time and then saves that back to the source - it usually looks something like this;

 

DataCard Update Property (on the card, not the dropdown itself):

 

DateValue1.SelectedDate + Time(Value(HourValue1.Selected.Value), Value(MinuteValue1.Selected.Value), 0)

The dateformat of the date dropdown can be shortdate, but it's the formula above that gets applied and saved along with the minutes and seconds, even if they're zero.

 

If this is the case, you should be able to just remove the minutes and seconds from the update formula, leaving the Update property as;

DateValue1.SelectedDate

 

Hope this helps,

 

RT

View solution in original post

Community Support
Community Support

Re: Date formatting adding time

Hi @zblankenship,

 

Could you please share a screenshot of the Edit form within your app?

How do you save your form data to your Excel file stored in your OneDrive? Using SubmitForm function or Patch function?

 

I agree with @RusselThomas's thought almost, please check if there is a HourValue Drop down control and MinuteValue Drop down control within the Data Card control which is associated with the Date picker control.

 

The Data Card control associated with Date picker control, HourValue Drop down control and MinuteValue Drop down control as below:9.JPG

 

 

Please take a try with the following workaround to fix your issue:

  1. Unlock the Data card control which is associated with the Date picker control.
  2. Set Update property of the Data card control to following formula:
DateValue1.SelectedDate

Note: The previous value within the Update property of the Data card control as below:

DateValue1.SelectedDate + Time(Value(HourValue1.Selected.Value), Value(MinuteValue1.Selected.Value), 0)

 

Best regards,

Kris

 

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Microsoft
Microsoft

Re: Date formatting adding time

Hi zblankenship,

 

Maybe check the Update property of the card housing the datepicker in the form - usually PowerApps detects the date format from the source and puts the datepicker constructs into the form for you - but these tend to include minutes and seconds, which you don't need.  It then constructs a datetime format from all three dropdowns used to collect date and time and then saves that back to the source - it usually looks something like this;

 

DataCard Update Property (on the card, not the dropdown itself):

 

DateValue1.SelectedDate + Time(Value(HourValue1.Selected.Value), Value(MinuteValue1.Selected.Value), 0)

The dateformat of the date dropdown can be shortdate, but it's the formula above that gets applied and saved along with the minutes and seconds, even if they're zero.

 

If this is the case, you should be able to just remove the minutes and seconds from the update formula, leaving the Update property as;

DateValue1.SelectedDate

 

Hope this helps,

 

RT

View solution in original post

Community Support
Community Support

Re: Date formatting adding time

Hi @zblankenship,

 

Could you please share a screenshot of the Edit form within your app?

How do you save your form data to your Excel file stored in your OneDrive? Using SubmitForm function or Patch function?

 

I agree with @RusselThomas's thought almost, please check if there is a HourValue Drop down control and MinuteValue Drop down control within the Data Card control which is associated with the Date picker control.

 

The Data Card control associated with Date picker control, HourValue Drop down control and MinuteValue Drop down control as below:9.JPG

 

 

Please take a try with the following workaround to fix your issue:

  1. Unlock the Data card control which is associated with the Date picker control.
  2. Set Update property of the Data card control to following formula:
DateValue1.SelectedDate

Note: The previous value within the Update property of the Data card control as below:

DateValue1.SelectedDate + Time(Value(HourValue1.Selected.Value), Value(MinuteValue1.Selected.Value), 0)

 

Best regards,

Kris

 

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

zblankenship Advocate I
Advocate I

Re: Date formatting adding time

I couldn't figure it out because the field that was generating the problem is invisible and I was doing all the fixing on a field that was visible. Thanks for your help.

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Top Solution Authors
Top Kudoed Authors
Users online (5,861)