Stopwatch - adding leading zeros to H,M,S times

The Chrono function uses #SWEH# #SWEM# #SWES# for Hours, Minutes and Seconds in the timer display. Is there a way to add leading zeros so you get a “00:00:00” kind of display?

The function I want to add this to is shown below (unless there is a better way of doing this):
(floor(#SWEH#%60)):(floor(#SWEM#%60)):(floor(#SWES#%60))

Any suggestions would be greatly appreciated.

$(floor(#SWES#%60))>9?(floor(#SWES#%60)):0(floor(#SWES#%60))$

Sorry, but I plugged that in and it didn’t work. Did you try it out at your end and got it to work?


You have to click in the middle of a watch face to start the chronometer.

You have duplicated the post, perhaps it is better to remove it.

Thank you very much for trying to help with this, but you can see from your own screenshot that this isn’t working. It should be displaying “00:00:00” on the watch face, and then when you start the chrono. the timer would start showing elapsed time.

You can also see that your formula gets to 60 seconds and then just restarts at zero. My post requested an H:M:S timer and not just seconds.

I think I see now that if I string the formulas together using H and then M and then S using your formula it should work. Something like this:
$(floor(#SWEH#%60))>9?(floor(#SWEH#%60)):0(floor(#SWEH#%60))$:$(floor(#SWEM#%60))>9?(floor(#SWEM#%60)):0(floor(#SWEM#%60))$:$(floor(#SWES#%60))>9?(floor(#SWES#%60)):0(floor(#SWES#%60))$

I’ll try that out.

Nope. That didn’t work. I’m new to using this kind of coding and don’t know how to string the expressions together

Are you sure this is not working? Then look at the corrected watch face upstairs. For some reason, I thought that you would have done the rest by yourself :slightly_smiling_face:

I had a “duh” moment in not figuring this out. I just placed three separate elements, one with #SWEH#, one with #SWEM# and one with #SWES#, each separated by a colon and it worked fine.

Thank you very much for helping me solve this.

1 Like