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

Stopwatch control - Press button to record start time and again to record end time and duration

Hi

I am trying to insert a stopwatch into my App.

I have start time, finish time and duration fields that I would like to fill in on each entry in my App.

I would like to push a button that records the time of day and starts a stop watch at the same time.

Then I would like to push another button that records the time of day again and stops the stopwatch entering the duration into my duration field.
I would like all three fields to have entries recorded when I close my App. Start, Finish, Duration.

I know this is a really easy one I am just a fool when it comes to formulas.

I have gone over what the support forum has to offer on time/stopwatch I cannot seem to crack it. I literally need stopwatch formula for dummies right now if possible.

If someone could please give me the formula for this I would greatly appreciate.

Thanks guys

Regards
Lorcan

5 REPLIES 5
Helper V
Helper V

I don't see any stopwatch control in powerapps, did you mean the timer control here https://powerapps.microsoft.com/en-us/tutorials/control-timer/?

Anonymous
Not applicable

Hi Leo09

Yes thats my mistake i meant the timer control.

I have a start time, finish time and duration fields that I would like to fill in on each entry in my App.

I would like to push a button that records the time of day in a text box and also starts a timer at the same time.(Which will be saved as duration in another textbox)

I would like to pusha scond button that records the time of day again and stops the timer entering the duration into my duration field/textbox.
I would like all three fields to have entries recorded when I close my App. Start, Finish, Duration.

All I want is a Start time, a finish time and a duration time. I know its really basic. I just cant find the formula.

Regards

Anonymous
Not applicable

 

Timer.jpgI just want a formula that gives me duration of a time. Thats all.

I have a sharepoint list. I created two columns each under the Date&Time format.

The first one is Start time. I left it as it is.
The second one is Finish Time. I turned the Visible property of the 'Date' part to false. In order to just be left with the time.

All I'd like to do is choose a date and time at the top, and then a few minutes later select a time in the 'Finish Time'.

And automatically for it to show the duration at the bottom.

Is this not possible? Any advice is welcome please.
I have gone over the countdown support forum. Not much help there.

Many thanks

Lorcan

New Member

Me too!! ANy answer to this?

To store start/end times and calculate duration, you can use a pair of buttons ("Start", "End") that stores the current time (via the Now function) in a variable. When you get the end time, you can subtract the value of the two variables to retrieve the duration (in days):

ButtonStart.OnSelect: UpdateContext({ startTime: Now(), duration:Blank() })
ButtonEnd.OnSelect: UpdateContext({ endTime: Now(), duration: endTime - startTime })

If you want to display the duration in hours:minutes:seconds.milliseconds, you can use the Time and Text functions to convert that (by converting the duration from days to milliseconds):

LabelDuration.Text: Text(Time(0, 0, 0, duration * 24 * 60 * 60 * 1000), "hh:mm:ss.fff")

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

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