# Calculated Time Not Showing on Phone but Shows Up in App Preview

**URL:** <https://forum.dimagi.com/t/calculated-time-not-showing-on-phone-but-shows-up-in-app-preview/3651>\
**Category:** Users\
**Created:** [July 30, 2017, 11:56am UTC](https://forum.dimagi.com/t/calculated-time-not-showing-on-phone-but-shows-up-in-app-preview/3651 "2017-07-30T11:56:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![YAW\_ANTWI-ADJEI](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/y/c0e974/32.png) [@YAW\_ANTWI-ADJEI](https://forum.dimagi.com/u/YAW_ANTWI-ADJEI)\
**Post date:** [July 30, 2017, 11:56am UTC](https://forum.dimagi.com/t/calculated-time-not-showing-on-phone-but-shows-up-in-app-preview/3651/1 "2017-07-30T11:56:53Z")

</div>

​Hello,  
I have an app which displays the time spent in filling a form as soon as  
you enter the very last data on the same form.

When I enter data using App Preview, it works fine as per the attached  
image but when I fill the form on Android Mobile phone it is not able to  
compute the time difference.

Please, any idea why this is so?

Yaw

[Calculated Time Not Showing on Phone.pdf](https://dimagi.b-cdn.net/uploads/default/original/1X/11d0fe6e1554c4b8c0b613fab2dd8b82d002dd12.pdf) (261 KB)

---

<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:** [July 31, 2017, 12:50pm UTC](https://forum.dimagi.com/t/calculated-time-not-showing-on-phone-but-shows-up-in-app-preview/3651/2 "2017-07-31T12:50:27Z")

</div>

Yaw,

Is it possible that that form was simply completed in under one minute?

Cheers,  
Will

> **···**
>
> On Sun, Jul 30, 2017 at 7:56 AM, YAW ANTWI-ADJEI wrote:
> 
> > ​Hello,  
> > I have an app which displays the time spent in filling a form as soon as  
> > you enter the very last data on the same form.
> > 
> > When I enter data using App Preview, it works fine as per the attached  
> > image but when I fill the form on Android Mobile phone it is not able to  
> > compute the time difference.
> > 
> > Please, any idea why this is so?
> > 
> > Yaw
> > 
> > --  
> > 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:** ![YAW\_ANTWI-ADJEI](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/y/c0e974/32.png) [@YAW\_ANTWI-ADJEI](https://forum.dimagi.com/u/YAW_ANTWI-ADJEI)\
**Post date:** [July 31, 2017, 12:56pm UTC](https://forum.dimagi.com/t/calculated-time-not-showing-on-phone-but-shows-up-in-app-preview/3651/3 "2017-07-31T12:56:54Z")

</div>

Hi Will,  
No. I intentionally delayed the filling of the form such that it will give  
me something more than 3 minutes.

In fact, I did it more than once and in all cases this was the result.  
​

> **···**
>
> On 31 July 2017 at 12:50, William Pride wrote:
> 
> > Yaw,
> > 
> > Is it possible that that form was simply completed in under one minute?
> > 
> > Cheers,  
> > Will
> > 
> > On Sun, Jul 30, 2017 at 7:56 AM, YAW ANTWI-ADJEI [yawantwiadjei@gmail.com](mailto:yawantwiadjei@gmail.com) wrote:
> > 
> > > ​Hello,  
> > > I have an app which displays the time spent in filling a form as soon as  
> > > you enter the very last data on the same form.
> > > 
> > > When I enter data using App Preview, it works fine as per the attached  
> > > image but when I fill the form on Android Mobile phone it is not able to  
> > > compute the time difference.
> > > 
> > > Please, any idea why this is so?
> > > 
> > > Yaw
> > > 
> > > --  
> > > 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 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:** ![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:** [July 31, 2017, 12:59pm UTC](https://forum.dimagi.com/t/calculated-time-not-showing-on-phone-but-shows-up-in-app-preview/3651/4 "2017-07-31T12:59:44Z")

</div>

I see. Could you post the calculations for these various hidden values  
(timeIn, timeOut, totalTime, endTime)?

Thanks,  
Will

> **···**
>
> On Mon, Jul 31, 2017 at 8:56 AM, YAW ANTWI-ADJEI wrote:
> 
> > Hi Will,  
> > No. I intentionally delayed the filling of the form such that it will give  
> > me something more than 3 minutes.
> > 
> > In fact, I did it more than once and in all cases this was the result.  
> > ​
> > 
> > On 31 July 2017 at 12:50, William Pride [wpride@dimagi.com](mailto:wpride@dimagi.com) wrote:
> > 
> > > Yaw,
> > > 
> > > Is it possible that that form was simply completed in under one minute?
> > > 
> > > Cheers,  
> > > Will
> > > 
> > > On Sun, Jul 30, 2017 at 7:56 AM, YAW ANTWI-ADJEI \<[yawantwiadjei@gmail.com](mailto:yawantwiadjei@gmail.com) wrote:
> > > 
> > > > ​Hello,  
> > > > I have an app which displays the time spent in filling a form as soon as  
> > > > you enter the very last data on the same form.
> > > > 
> > > > When I enter data using App Preview, it works fine as per the attached  
> > > > image but when I fill the form on Android Mobile phone it is not able to  
> > > > compute the time difference.
> > > > 
> > > > Please, any idea why this is so?
> > > > 
> > > > Yaw
> > > > 
> > > > --  
> > > > 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 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 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:** ![YAW\_ANTWI-ADJEI](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/y/c0e974/32.png) [@YAW\_ANTWI-ADJEI](https://forum.dimagi.com/u/YAW_ANTWI-ADJEI)\
**Post date:** [July 31, 2017, 1:29pm UTC](https://forum.dimagi.com/t/calculated-time-not-showing-on-phone-but-shows-up-in-app-preview/3651/5 "2017-07-31T13:29:26Z")

</div>

Hi,  
Please see attached.  
I actually used StartTime, EndTime, TotalTime and DurationMinutes for the  
computations.

1.\* StartTime\*: This is a Hidden Value with Default Value field set to:  
_double(now())_

2.\* EndTime\*: This is a Hidden Value with Calculate Condition field set to:  
_double(now())_

3.\* TotalTime\*: This is a Hidden Value with Calculate Condition set to:  
EndTime - StartTime

4.\* DurationMinutes\*: This is a Hidden Value with Calculate Condition set  
to: int(((#form/TotalTtime \* 24) - int(#form/TotalTtime \* 24)) \* 60)

My TimeIn and TimeOut were only used to display time. They are all Hidden  
Values.  
TimeIn has Default Value set as: format-date(now(), '%H:%M') whilst TimeOut  
has the Calculate Condition set as: format-date(now(), '%H:%M')

Yaw

[Screenshots for Calculated Time.pdf](https://dimagi.b-cdn.net/uploads/default/original/1X/6d3a0432d2500422107b9ce60a32f97a7779f856.pdf) (511 KB)

> **···**
>
> On 31 July 2017 at 12:59, William Pride wrote:
> 
> > I see. Could you post the calculations for these various hidden values  
> > (timeIn, timeOut, totalTime, endTime)?
> > 
> > Thanks,  
> > Will
> > 
> > On Mon, Jul 31, 2017 at 8:56 AM, YAW ANTWI-ADJEI [yawantwiadjei@gmail.com](mailto:yawantwiadjei@gmail.com) wrote:
> > 
> > > Hi Will,  
> > > No. I intentionally delayed the filling of the form such that it will  
> > > give me something more than 3 minutes.
> > > 
> > > In fact, I did it more than once and in all cases this was the result.  
> > > ​
> > > 
> > > On 31 July 2017 at 12:50, William Pride [wpride@dimagi.com](mailto:wpride@dimagi.com) wrote:
> > > 
> > > > Yaw,
> > > > 
> > > > Is it possible that that form was simply completed in under one minute?
> > > > 
> > > > Cheers,  
> > > > Will
> > > > 
> > > > On Sun, Jul 30, 2017 at 7:56 AM, YAW ANTWI-ADJEI \< [yawantwiadjei@gmail.com](mailto:yawantwiadjei@gmail.com)\> wrote:
> > > > 
> > > > > ​Hello,  
> > > > > I have an app which displays the time spent in filling a form as soon  
> > > > > as you enter the very last data on the same form.
> > > > > 
> > > > > When I enter data using App Preview, it works fine as per the attached  
> > > > > image but when I fill the form on Android Mobile phone it is not able to  
> > > > > compute the time difference.
> > > > > 
> > > > > Please, any idea why this is so?
> > > > > 
> > > > > Yaw
> > > > > 
> > > > > --  
> > > > > 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 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 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 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:** ![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:** [July 31, 2017, 4:29pm UTC](https://forum.dimagi.com/t/calculated-time-not-showing-on-phone-but-shows-up-in-app-preview/3651/6 "2017-07-31T16:29:08Z")

</div>

Hi Yaw,

Interesting, your form configuration looks good - could you please report a  
bug [https://confluence.dimagi.com/display/commcarepublic/Bug+Reports](https://confluence.dimagi.com/display/commcarepublic/Bug+Reports) so  
that our team can take a closer look?

Thanks,  
Will

> **···**
>
> On Mon, Jul 31, 2017 at 9:29 AM, YAW ANTWI-ADJEI wrote:
> 
> > Hi,  
> > Please see attached.  
> > I actually used StartTime, EndTime, TotalTime and DurationMinutes for the  
> > computations.
> > 
> > 1.\* StartTime\*: This is a Hidden Value with Default Value field set to:  
> > _double(now())_
> > 
> > 2.\* EndTime\*: This is a Hidden Value with Calculate Condition field set  
> > to: _double(now())_
> > 
> > 3.\* TotalTime\*: This is a Hidden Value with Calculate Condition set to:  
> > EndTime - StartTime
> > 
> > 4.\* DurationMinutes\*: This is a Hidden Value with Calculate Condition set  
> > to: int(((#form/TotalTtime \* 24) - int(#form/TotalTtime \* 24)) \* 60)
> > 
> > My TimeIn and TimeOut were only used to display time. They are all Hidden  
> > Values.  
> > TimeIn has Default Value set as: format-date(now(), '%H:%M') whilst  
> > TimeOut has the Calculate Condition set as: format-date(now(), '%H:%M')
> > 
> > Yaw
> > 
> > On 31 July 2017 at 12:59, William Pride [wpride@dimagi.com](mailto:wpride@dimagi.com) wrote:
> > 
> > > I see. Could you post the calculations for these various hidden values  
> > > (timeIn, timeOut, totalTime, endTime)?
> > > 
> > > Thanks,  
> > > Will
> > > 
> > > On Mon, Jul 31, 2017 at 8:56 AM, YAW ANTWI-ADJEI \<[yawantwiadjei@gmail.com](mailto:yawantwiadjei@gmail.com) wrote:
> > > 
> > > > Hi Will,  
> > > > No. I intentionally delayed the filling of the form such that it will  
> > > > give me something more than 3 minutes.
> > > > 
> > > > In fact, I did it more than once and in all cases this was the result.  
> > > > ​
> > > > 
> > > > On 31 July 2017 at 12:50, William Pride [wpride@dimagi.com](mailto:wpride@dimagi.com) wrote:
> > > > 
> > > > > Yaw,
> > > > > 
> > > > > Is it possible that that form was simply completed in under one minute?
> > > > > 
> > > > > Cheers,  
> > > > > Will
> > > > > 
> > > > > On Sun, Jul 30, 2017 at 7:56 AM, YAW ANTWI-ADJEI \< [yawantwiadjei@gmail.com](mailto:yawantwiadjei@gmail.com)\> wrote:
> > > > > 
> > > > > > ​Hello,  
> > > > > > I have an app which displays the time spent in filling a form as soon  
> > > > > > as you enter the very last data on the same form.
> > > > > > 
> > > > > > When I enter data using App Preview, it works fine as per the attached  
> > > > > > image but when I fill the form on Android Mobile phone it is not able to  
> > > > > > compute the time difference.
> > > > > > 
> > > > > > Please, any idea why this is so?
> > > > > > 
> > > > > > Yaw
> > > > > > 
> > > > > > --  
> > > > > > 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 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 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 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 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).
