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.
Solved! Go to Solution.
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:
Regards,
Michael
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:
Regards,
Michael
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.
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.
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?
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.
@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?
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
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
SharePoint regional settings page
SharePoint 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.
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?
User | Count |
---|---|
122 | |
87 | |
86 | |
75 | |
67 |
User | Count |
---|---|
214 | |
180 | |
137 | |
96 | |
83 |