# Addition of Two Value in Time Format (0-60)

**URL:** <https://forum.inductiveautomation.com/t/addition-of-two-value-in-time-format-0-60/8151>\
**Category:** General Discussion\
**Created:** [March 14, 2014, 11:46am UTC](https://forum.inductiveautomation.com/t/addition-of-two-value-in-time-format-0-60/8151 "2014-03-14T11:46:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajay](https://avatars.discourse-cdn.com/v4/letter/a/f4b2a3/32.png) [@ajay](https://forum.inductiveautomation.com/u/ajay)\
**Post date:** [March 14, 2014, 11:46am UTC](https://forum.inductiveautomation.com/t/addition-of-two-value-in-time-format-0-60/8151/1 "2014-03-14T11:46:00Z")

</div>

I wanted to add time in Ignition project.

I have Numeric Text field and entering decimal value to this. I am trying to add 0.47 and 0.32. The end result is 0.79. But I wanted to convert the same into time(0-60) and the answer supposed to be 1.19. How can I make this…

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [March 14, 2014, 2:39pm UTC](https://forum.inductiveautomation.com/t/addition-of-two-value-in-time-format-0-60/8151/2 "2014-03-14T14:39:06Z")

</div>

There are a number of ways to do this, depending on what you’d like to do with the result. The script below gives a couple of suggestions that might get you going:

[code]a = 0.47  
b = 0.32

# treat a+b as numbers, faux mod 0.60

temp = 0  
sum = a+b  
while sum \>= 0.60:  
temp = temp + 1  
sum = sum - 0.60

temp = temp + sum  
print a,"+",b,"=",temp

# treat a + b as time

from datetime import timedelta  
t1 = timedelta(minutes=(a_100))  
t2 = timedelta(minutes=(b_100))  
print t1,"+",t2,"=",t1+t2[/code]

The output of this is `0.47 + 0.32 = 1.19
0:47:00 + 0:32:00 = 1:19:00
`

---

<div class="post-metadata">

**Author:** ![ajay](https://avatars.discourse-cdn.com/v4/letter/a/f4b2a3/32.png) [@ajay](https://forum.inductiveautomation.com/u/ajay)\
**Post date:** [March 17, 2014, 9:13am UTC](https://forum.inductiveautomation.com/t/addition-of-two-value-in-time-format-0-60/8151/3 "2014-03-17T09:13:19Z")

</div>

Thanks for your update.

How do i apply the same in screen or using Sql Tags. Because these are neither expression nor query.

Can you tell me step by step after i enter a (0.47) & b (0.32) values through normal Numeric Text filed.

---

<div class="post-metadata">

**Author:** ![Colby.Clegg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/colby.clegg/32/3282_2.png) [@Colby.Clegg](https://forum.inductiveautomation.com/u/Colby.Clegg)\
**Post date:** [March 18, 2014, 4:56pm UTC](https://forum.inductiveautomation.com/t/addition-of-two-value-in-time-format-0-60/8151/4 "2014-03-18T16:56:58Z")

</div>

Maybe an expression tag like this?

```auto
toInt((({[.]a}+{[.]b})*100)/60) + ((({[.]a}+{[.]b})*100)%60)/100
```
