# Display time duration from DINT

**URL:** <https://forum.inductiveautomation.com/t/display-time-duration-from-dint/103548>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [March 11, 2025, 8:53pm UTC](https://forum.inductiveautomation.com/t/display-time-duration-from-dint/103548 "2025-03-11T20:53:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![BigByte](https://avatars.discourse-cdn.com/v4/letter/b/f17d59/32.png) [@BigByte](https://forum.inductiveautomation.com/u/BigByte)\
**Post date:** [March 11, 2025, 8:53pm UTC](https://forum.inductiveautomation.com/t/display-time-duration-from-dint/103548/1 "2025-03-11T20:53:26Z")

</div>

I've got two tags from a PLC that represent a timer duration. One is the target time (the endpoint), and one is the current value of the timer. I want to display these in a view using a label for the target and a progress bar for the current time. Since the PLC handles them as DINTs (with the value being milliseconds), converting to a datetime type was weird, but I made it look correct on the label by using a transform and forcing it to UTC time zone, so 0 is actually 0, and the duration would look correct for the 24 hour time.

However, on the progress bar, I can't seem to get the valueDisplay/format property to show the time correctly. It seems no matter what I do, it keeps representing the DINT as seconds, so the time it shows is 1000x longer than it should be.

I tried doing the transform on the "max" and "value" properties of the progress bar, but I got an error because it was expecting a numerical value instead of the datetime string. I can make a custom property that's just the PLC tag / 1000 to represent seconds, but is there any way to make the text displayed on the progress bar point to the custom property instead of the predefined "value" property?

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [March 11, 2025, 10:22pm UTC](https://forum.inductiveautomation.com/t/display-time-duration-from-dint/103548/2 "2025-03-11T22:22:06Z")

</div>

> [@BigByte](#):
>
> It seems no matter what I do, it keeps representing the DINT as seconds, so the time it shows is 1000x longer than it should be.

How do you actually want it to display the duration? If you want it in seconds, you **can** just divide it by 1000 in the `props.value` expression binding. If you set the `props.valueDisplay.format` to "duration", then you can show the duration in HH:mm:ss assuming the value you provide is in seconds (or converted to second as above)

---

<div class="post-metadata">

**Author:** ![BigByte](https://avatars.discourse-cdn.com/v4/letter/b/f17d59/32.png) [@BigByte](https://forum.inductiveautomation.com/u/BigByte)\
**Post date:** [March 12, 2025, 12:56pm UTC](https://forum.inductiveautomation.com/t/display-time-duration-from-dint/103548/3 "2025-03-12T12:56:39Z")

</div>

I want to display the duration in `HH:mm:ss.SSS` format, with the PLC tags being ms. I did try formatting `valueDisplay.format` like that, but the valueDisplay won't show the millisecond portion of it (also tried formatting as `00:00:00.000` and `00:00:00.###`), and instead represents the PLC tag incorrectly.

And I did try dividing `props.value` by 1000, but what I did not try was also dividing `props.max` by 1000 so the `max` and `value` remained at the same scale. I guess I can just drop off the decimal after that and not display the ms.

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [March 12, 2025, 1:02pm UTC](https://forum.inductiveautomation.com/t/display-time-duration-from-dint/103548/4 "2025-03-12T13:02:43Z")

</div>

Have you searched this forum for similar posts, like this one?

> [@OPC Tag Value Seconds to HH:MM:SS via Expression Tag](https://forum.inductiveautomation.com/t/opc-tag-value-seconds-to-hhss-via-expression-tag/45544):
>
> I’ve read through a few examples of converting seconds to HH:MM:SS but none of them seem to directly address or fully solve my problem. Apologies if I missed a better question and resolution elsewhere. I have a series of modbus registers that return a runtime in seconds as a float value. I would like to use an expression tag to provide a string (not date time) representation of the seconds in HH:MM:SS format, think stopwatch and not clock. I have found the following script to (mostly) work: i…

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [March 12, 2025, 8:36pm UTC](https://forum.inductiveautomation.com/t/display-time-duration-from-dint/103548/5 "2025-03-12T20:36:55Z")

</div>

The issue I think is more displaying the right format inaide the progress component. The format appears fixed at h m s for the component.

However there's also the option of putting it in a coord container with a label and then you can do what you want inside the label
