Timer woes again

I know this subject has had the stuffing beaten out of it myriad of times, but i still don't understand some of the ... um quirks?
In this video, with the timer set to 1 second, the timer face changes, but the instance does not update. what the heck?

The timepicker instant is static...

gotcha. thanks Tim

So the critical part of the whole time equation is not the instant, but the "hh:mm:ss a" in order to interpret that at any other time/place as a time.
So I could save the start and end times to an activity as a simple text, and then having to edit that, i can just [make instant] from said text.

You may want to explain what you are trying to achieve, then we can find a solution...

the goal is to be able to enter working hours, start time and end time. These will be recorded in a log to track hours on a project. There is an option to automatically set the start time to 8 am. If for any reason the start is manually changed, the time recorded is incorrect. I think it defaults to the initial priming of the time picker, correct?
The point is, the record does not follow the 'text' on the time picker all the time so by entering the record at a later date, though it may show the user worked 8 hours, the start and end time may show something completely different, in some cases the time the record was entered, thus start and end time being the same.
Your solution was to save time(now), but that will record start and end time as time(now).
Also, to make it more difficult, I want the time format to be more readable (the difference between US and world time in digits causes confusion, 08/12/2023. Is that the 8th of december or 12 of august?!?)
I force the format to D dd MMM YYYY (Sat 8 Aug) so there is no confusion.
Did that muddly the waters??
I have started a separate mini app just for working on a timer, as each time I think I had it, they trip me up.

This is all about managing the values of variables.

Say you set a start time - 0800 (which is past the current time - 1100). Firstly you want to get the difference - 3 hours, you then can count from here (current time) and add each second to the difference. If you then have an end time - 1700, this would be 6 hours after current time, you can then set a time for the clock to stop.

Is that the sort of thing you are after ?

Almost. The clock is not running like a stop watch whilst the user is working. The user would open the app (if he remembers) in the morning, set the start time by clicking on the time picker then get on with work. If s/he forgets to set the time in the morning, it can be done anytime before capturing the record. (Once the record is captured and submitted to HR, it is rendered uneditable due to payroll, taxes etc...zzz)
At the end of the day, the user would open the app again and click on the end timer to calculate the days hours, expenses etc.
However, the instances don't always match up.

I debated the stopwatch idea, but just in case the operator forgot to stop it, I had to calculate in automatic stops according to local labour by-laws or common sense, and the variables started to stack up like crazy.

Your data structure could look like

except you only have two checkpoints, In and Out.

:exploding_head:

It will take me a while to decipher that situation. On the outset though, it looks way more complicated that what i am trying to achieve..

The way to do what you want (?) is to take the elements of date and time pickers and build instants from them, then calculate hours/mins worked afterwards. The time picker instants are of no use.

image

clockingon.aia (5.4 KB)

Note: I did not build in a reset button...

That makes sense. Stay away from the instant. I will give that a whirl and see what gives. cheers mate

And there we go. I'm going to test this set up to make sure it works. And with the added date in the instant, I can include over night shifts too. I would have a send date picker in the app

Thanks again Tim!!

So, I thought I had it down, and I do to a certain degree. I can set and calculate times and duration periods like a pro...What I need now is to figure out how to change and set a time picker at run time, and then use that "instant' to recalculate, or confirm original calculations.

From my blocks, it might be easiest to add a third/fourth timepicker/s, and then replace the new hour/minute times for the startTime/endTime lists ?

I save the values to a tiny db, then can reload the information for visual inspection, or on occasion an edit of times, meal breaks etc.
I made a few tweaks, and it seems to work now.
Hmm.
recap: i save this;
Screenshot 2025-02-12 18.42.01

and reload this and assign to a time picker:

That seems to work. And from there I can recalculate duration, pay packet, taxes etc.