Hi everyone,
I''m building a mobile app.
In this app, I am trying to set a notification that show the time difference between time 1 (beginning) and time 2 (end). I have succeeded in the calculation but not in the formatting.
To go straight to point
begin. value = 2024-08-21 10:00:00
end.value = 2024-08-21 10:00:50
moment(end.value).diff(begin. Value, 'seconds')
-> it shows "the time spent is 50 seconds"
Now i would format this time "HH:mm:ss"
to get "the time spent is 00:00:50"
I tried this but shows 01:00:50
instead of "00:00:50"
:
moment(moment(end.value).diff(begin. Value, 'seconds') ).format("HH:mm:ss")
What's wrong?
any suggestion?