cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Date Time Picker -- Missing Time

I added the Date control to a card but the time portion is not present.  I am using the current version of PowerApps.

What should I do to be able to also choose a time?  I am using the Web version on a PC if that affects my view.

 

Thank you,

 

 

W.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Date Time Picker -- Missing Time

Hi @Anonymous,

 

The DatePicker control is only available for Date, there is no time control available under PowerApps.

To workaround this, we need to add two dropdown, one for hour, and another for Minutes

HourDropdown:

Items property (24 hours):

["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"]

MinutesDropdown:

Items property:

["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59"]

Together with the DatePicker control, within one DataCard, then use the following formula to combine the time value with the date value under the Update property of the DataCard control:

DateValue1.SelectedDate + Time(Value(HourDropdown.Selected.Value), Value(MinutesDropdown.Selected.Value), 0)

Reference:

86.PNG

 

Regards,

Michael

Community Support Team _ Michael Shao
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

9 REPLIES 9
Highlighted
Community Support
Community Support

Re: Date Time Picker -- Missing Time

Hi @Anonymous,

 

The DatePicker control is only available for Date, there is no time control available under PowerApps.

To workaround this, we need to add two dropdown, one for hour, and another for Minutes

HourDropdown:

Items property (24 hours):

["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"]

MinutesDropdown:

Items property:

["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59"]

Together with the DatePicker control, within one DataCard, then use the following formula to combine the time value with the date value under the Update property of the DataCard control:

DateValue1.SelectedDate + Time(Value(HourDropdown.Selected.Value), Value(MinutesDropdown.Selected.Value), 0)

Reference:

86.PNG

 

Regards,

Michael

Community Support Team _ Michael Shao
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

Highlighted
Anonymous
Not applicable

Re: Date Time Picker -- Missing Time

That worked perfectly. 

 

I like this solution a lot because I actually wanted to restrict the minutes to every 15 or 30 minutes, so I was able to achieve that.

 

Minutes property:

["00","15","30","45"] or ["00","30"] 

 

Thank you,

 

W.

Highlighted
Regular Visitor

Re: Date Time Picker -- Missing Time

I did this by using a Label and Slider.

 

Slider called sldTimer

 

The Min property of sldTimer to 0

The Max property of the sldTimer to the number of increments of the time in a 24 hour period you want to jump. In my example I wanted to go up by 5 minute intervals so just quickly calculated how many 5 minutes there are in 24 hours:

 

Number of increments = 24*60/5

 

Label called lblTime

 

set Text property of lblTime to:

 

Text(Time(RoundDown((sldTimer.Value * 5)/60,0), Mod(sldTimer.Value * 5, 60) - Mod(Mod(sldTimer.Value * 5, 60), 5), 00), "[$-en-US]HH:mm AM/PM")

 

for the above the 5 represents the time increment I am looking for and 60 is the number of minutes in an hour.

 

Obviously some of the maths would change if you want it to go up by seconds, or you just want to create a timer between two specific times, but not difficult to extrapolate the above.

 

Capture.PNG

 

 

 

Highlighted
Kudo Kingpin
Kudo Kingpin

Re: Date Time Picker -- Missing Time

Michael I love your solution, although what do you recommend for a version of this that uses am and pm? Is there an efficent way to have a time picker that goes to 12 and then starts over, or one with an am/pm option?

Highlighted
Anonymous
Not applicable

Re: Date Time Picker -- Missing Time

Hello I am trying to set Timer and I am getting problem with the + sign when trying update Card and error is saying:Expected Record Value. hour and minute drop downs and date picker are good without any errors. I have attached screen shot of the error and function.

Highlighted
Kudo Kingpin
Kudo Kingpin

Re: Date Time Picker -- Missing Time

@Anonymous 

You should make this a new question! It doesn't relate to the question being asked on this thread. 

 

Also, what do you mean by "set a timer"? Are you setting the value on the Duration property of a Timer control?

Post Prodigy
Post Prodigy

Re: Date Time Picker -- Missing Time

Thanks Michael. So based on your solution, I have From and To as two date picker controls added in powerapps and also the Hours and mins drop-downs as well:. Now how do i calculate a decimal difference between the two?

 

Let's say:1 From Field: User selects: 5 (in hours drop down) , 00 (in mins drop Down)

              2. To Field user selects: 6 (in hours drop down), 40 (in mins dd) 

 

So how can i calculate the difference in decimal which would be 1.7 between 5 and 6:40 pm, thoughts? @v-micsh-msft 

 

Highlighted

Re: Date Time Picker -- Missing Time

Hi @sblake 

 

In Powerapps form only date is selecting but its displaying 12/12/2019 4:30 instead of 12/12/2019 00:00. how to get rid of hours issue.

User selected time is not displaying in SharePoint

SPitem.PNG

 

 

 

 

 

 

 

SharePoint regional settings page 

SharePoint Regional settings PageSharePoint Regional settings Page 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

as per business regional settings page

Yes i tried/switched from Local to UTC in powerapps but still no luck its saving different hours.

 

any help would be appreciate.

 

Highlighted
Frequent Visitor

Re: Date Time Picker -- Missing Time

Hi Please assist. I'm using a gallery linked to a collection and I added the date picker, hours, minutes and seconds dropdown. My challenge is how do I add a DataCard to link the three?

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (7,001)