# OPC Tag Value Seconds to HH:MM:SS via Expression Tag

**URL:** <https://forum.inductiveautomation.com/t/opc-tag-value-seconds-to-hhss-via-expression-tag/45544>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [April 13, 2021, 5:18pm UTC](https://forum.inductiveautomation.com/t/opc-tag-value-seconds-to-hhss-via-expression-tag/45544 "2021-04-13T17:18:37Z")\
**Posts on this page:** 1\
**Showing post:** 21

<div class="post-metadata">

**Author:** ![WillMT10](https://avatars.discourse-cdn.com/v4/letter/w/7feea3/32.png) [@WillMT10](https://forum.inductiveautomation.com/u/WillMT10)\
**Post date:** [April 28, 2021, 4:25pm UTC](https://forum.inductiveautomation.com/t/opc-tag-value-seconds-to-hhss-via-expression-tag/45544/21 "2021-04-28T16:25:28Z")

</div>

Are you sure that is exactly the expression you are using? When I put 143,164 into my expression posted above, it returns `01:15:46:04` correctly.

```auto
if(
	isNull(143164),
	"00:00:00:00",
	stringFormat(
		"%02d:%02d:%02d:%02d",
		toInt(floor(143164 / (24 * 3600))),
		toInt(floor(143164 % (24 * 3600) / 3600)),
		toInt(floor(143164 % 3600 / 60)),
		toInt(floor(143164 % 60))
	)
)

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/opc-tag-value-seconds-to-hhss-via-expression-tag/45544)._
