# Hours from timestamp ok minutes not ok

**URL:** <https://community.thunkable.com/t/hours-from-timestamp-ok-minutes-not-ok/1655182>\
**Category:** Questions about Thunkable X\
**Created:** [December 15, 2021, 4:38pm UTC](https://community.thunkable.com/t/hours-from-timestamp-ok-minutes-not-ok/1655182 "2021-12-15T16:38:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bibbi](https://avatars.discourse-cdn.com/v4/letter/b/db5fbb/32.png) [@bibbi](https://community.thunkable.com/u/bibbi)\
**Post date:** [December 15, 2021, 4:38pm UTC](https://community.thunkable.com/t/hours-from-timestamp-ok-minutes-not-ok/1655182/1 "2021-12-15T16:38:58Z")

</div>

hi

I was inspired by another forum for the formulas I get the hours but I can’t get the minutes  
diff or duration being the difference between two timestamps

 ![Capture d’écran 2021-12-15 à 17.37.56](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/1/51fce8a07ee74bb6574553a2dfc10d36dc85bf63.png)

the translation of these blocks does not work

 ![Capture d’écran 2021-12-15 à 17.41.00](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/a/1a0cd74663341dc084a1b1b2d453cc8c11f85956.png)

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [December 15, 2021, 4:55pm UTC](https://community.thunkable.com/t/hours-from-timestamp-ok-minutes-not-ok/1655182/2 "2021-12-15T16:55:54Z")

</div>

Can you explain more what does not work?

You have a `start time` and an `end time` and you take the difference and then check that if does not exceed a **day**.

From her you take the number of seconds (as the difference between the start and end) and divide by 3600 to get number of hours.

Now, you need to subtract number of hours from the difference to be able to compute the number of minutes.

This is easy math.

Check this example:

Setup variables:  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/6/c6edb194161c322019b1d33fa84a3c2e8b4e4f39.png)

Working blocks:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/f/8f614034a746ef44f193e0bc134a4c7ec75f433d.png)

Sample output:  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/3/0377b42c9571edfc7fc9b13aa1335875d82e19a6.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [March 15, 2022, 4:56pm UTC](https://community.thunkable.com/t/hours-from-timestamp-ok-minutes-not-ok/1655182/3 "2022-03-15T16:56:03Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
