# Calculating Amount of hours Based on time Inserted

**URL:** <https://forum.dimagi.com/t/calculating-amount-of-hours-based-on-time-inserted/3726>\
**Category:** Users\
**Created:** [September 25, 2017, 12:03pm UTC](https://forum.dimagi.com/t/calculating-amount-of-hours-based-on-time-inserted/3726 "2017-09-25T12:03:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ralph\_Kawatira](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/r/4da419/32.png) [@Ralph\_Kawatira](https://forum.dimagi.com/u/Ralph_Kawatira)\
**Post date:** [September 25, 2017, 12:03pm UTC](https://forum.dimagi.com/t/calculating-amount-of-hours-based-on-time-inserted/3726/1 "2017-09-25T12:03:22Z")

</div>

I want to create an APP which calculates the number of hours based on time  
being put. Say the first time was 12:00 and the closing time is 14:00 it  
should calculate that 2 hours spent. I want to create an APP for car  
parking but it should calculate the amount based on hours a car has parked.

---

<div class="post-metadata">

**Author:** ![William\_Pride](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/w/b19c9b/32.png) [@William\_Pride](https://forum.dimagi.com/u/William_Pride)\
**Post date:** [September 25, 2017, 5:03pm UTC](https://forum.dimagi.com/t/calculating-amount-of-hours-based-on-time-inserted/3726/2 "2017-09-25T17:03:48Z")

</div>

Hello,

This page  
[https://confluence.dimagi.com/display/commcarepublic/Calculations+with+Dates+and+Times](https://confluence.dimagi.com/display/commcarepublic/Calculations+with+Dates+and+Times)  
should  
explain how to build such a calculation.

Cheers,  
Will

> **···**
>
> On Mon, Sep 25, 2017 at 8:03 AM, Ralph kawatira wrote:
> 
> > I want to create an APP which calculates the number of hours based on time  
> > being put. Say the first time was 12:00 and the closing time is 14:00 it  
> > should calculate that 2 hours spent. I want to create an APP for car  
> > parking but it should calculate the amount based on hours a car has parked.
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "commcare-users" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [commcare-users+unsubscribe@googlegroups.com](mailto:commcare-users+unsubscribe@googlegroups.com).  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Ralph\_Kawatira](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/r/4da419/32.png) [@Ralph\_Kawatira](https://forum.dimagi.com/u/Ralph_Kawatira)\
**Post date:** [September 25, 2017, 5:08pm UTC](https://forum.dimagi.com/t/calculating-amount-of-hours-based-on-time-inserted/3726/3 "2017-09-25T17:08:38Z")

</div>

Thanks a lot for your help

> **···**
>
> On Mon, 25 Sep 2017 at 19:05 William Pride wrote:
> 
> > Hello,
> > 
> > This page  
> > [https://confluence.dimagi.com/display/commcarepublic/Calculations+with+Dates+and+Times](https://confluence.dimagi.com/display/commcarepublic/Calculations+with+Dates+and+Times) should  
> > explain how to build such a calculation.
> > 
> > Cheers,  
> > Will
> > 
> > On Mon, Sep 25, 2017 at 8:03 AM, Ralph kawatira [rkfraaz@gmail.com](mailto:rkfraaz@gmail.com) wrote:
> > 
> > > I want to create an APP which calculates the number of hours based on  
> > > time being put. Say the first time was 12:00 and the closing time is 14:00  
> > > it should calculate that 2 hours spent. I want to create an APP for car  
> > > parking but it should calculate the amount based on hours a car has parked.
> > 
> > --
> > 
> > > You received this message because you are subscribed to the Google Groups  
> > > "commcare-users" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send an  
> > > email to [commcare-users+unsubscribe@googlegroups.com](mailto:commcare-users+unsubscribe@googlegroups.com).
> > 
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > You received this message because you are subscribed to a topic in the  
> > Google Groups "commcare-users" group.  
> > To unsubscribe from this topic, visit  
> > [https://groups.google.com/d/topic/commcare-users/JL7eE0OU\_xc/unsubscribe](https://groups.google.com/d/topic/commcare-users/JL7eE0OU_xc/unsubscribe).  
> > To unsubscribe from this group and all its topics, send an email to  
> > [commcare-users+unsubscribe@googlegroups.com](mailto:commcare-users+unsubscribe@googlegroups.com).  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> _With Kind Regards_
> 
> Ralph Kawatira  
> ICT Officer  
> Catholic Development Commission Chikwawa Diocese  
> UBALE PROGRAM  
> +265 999 124 096 / +265 882 477 997  
> Skype:ralph89k

---

<div class="post-metadata">

**Author:** ![Lameez\_Alexander](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/l/ecd19e/32.png) [@Lameez\_Alexander](https://forum.dimagi.com/u/Lameez_Alexander)\
**Post date:** [October 4, 2017, 9:11pm UTC](https://forum.dimagi.com/t/calculating-amount-of-hours-based-on-time-inserted/3726/4 "2017-10-04T21:11:10Z")

</div>

Hi,

I have a similar question, but the guidelines in the link are not exactly  
what I need as most of it uses the now() function to calculate.

I would like collect data on hours worked per day, so responses would be in  
the form of Day1 9am-3pm, Day2 5-10pm.

How can I calculate the total number of hours worked per day?

Thanks!

> **···**
>
> On Monday, September 25, 2017 at 7:08:56 PM UTC+2, Ralph kawatira wrote: \> \> Thanks a lot for your help \> \> On Mon, 25 Sep 2017 at 19:05 William Pride \<wpr...@dimagi.com \> wrote: \> \>\> Hello, \>\> \>\> This page \>\> should \>\> explain how to build such a calculation. \>\> \>\> Cheers, \>\> Will \>\> \>\> On Mon, Sep 25, 2017 at 8:03 AM, Ralph kawatira \<rkf...@gmail.com \> wrote: \>\> \>\>\> I want to create an APP which calculates the number of hours based on \>\>\> time being put. Say the first time was 12:00 and the closing time is 14:00 \>\>\> it should calculate that 2 hours spent. I want to create an APP for car \>\>\> parking but it should calculate the amount based on hours a car has parked. \>\>\> \>\> -- \>\>\> You received this message because you are subscribed to the Google \>\>\> Groups "commcare-users" group. \>\>\> To unsubscribe from this group and stop receiving emails from it, send \>\>\> an email to commcare-user...@googlegroups.com . \>\> \>\> \>\>\> For more options, visit https://groups.google.com/d/optout. \>\>\> \>\> -- \>\> You received this message because you are subscribed to a topic in the \>\> Google Groups "commcare-users" group. \>\> To unsubscribe from this topic, visit \>\> https://groups.google.com/d/topic/commcare-users/JL7eE0OU\_xc/unsubscribe. \>\> To unsubscribe from this group and all its topics, send an email to \>\> commcare-user...@googlegroups.com . \>\> For more options, visit https://groups.google.com/d/optout. \>\> \> -- \> \*With Kind Regards\* \> \> Ralph Kawatira \> ICT Officer \> Catholic Development Commission Chikwawa Diocese \> UBALE PROGRAM \> +265 999 124 096 / +265 882 477 997 \> Skype:ralph89k \>

---

<div class="post-metadata">

**Author:** ![JayH](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/j/6a8cbe/32.png) [@JayH](https://forum.dimagi.com/u/JayH)\
**Post date:** [May 17, 2019, 10:23am UTC](https://forum.dimagi.com/t/calculating-amount-of-hours-based-on-time-inserted/3726/5 "2019-05-17T10:23:31Z")

</div>

Hi @Lameez_Alexander

Did you find a solution to this please? I am working on something similar.
