# Formatting label to display a plc tag as time

**URL:** <https://forum.inductiveautomation.com/t/formatting-label-to-display-a-plc-tag-as-time/12333>\
**Category:** Ignition\
**Created:** [November 8, 2016, 4:28pm UTC](https://forum.inductiveautomation.com/t/formatting-label-to-display-a-plc-tag-as-time/12333 "2016-11-08T16:28:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Csantaw](https://avatars.discourse-cdn.com/v4/letter/c/9de0a6/32.png) [@Csantaw](https://forum.inductiveautomation.com/u/Csantaw)\
**Post date:** [November 8, 2016, 4:28pm UTC](https://forum.inductiveautomation.com/t/formatting-label-to-display-a-plc-tag-as-time/12333/1 "2016-11-08T16:28:16Z")

</div>

Hi,

I’m trying to format an INT4 tag from my plc onto a label as a time format. for example

Tag1= 112434  
Label display= 11:24:34

I’ve tried the standard numberformat expression  
numberformat({Tag1},“00:00:00”)  
which gives me the following  
112434::

I have also tried binding a formatted text field input to my tag but it displays nothing.

any ideas?

---

<div class="post-metadata">

**Author:** ![JGJohnson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jgjohnson/32/29582_2.png) [@JGJohnson](https://forum.inductiveautomation.com/u/JGJohnson)\
**Post date:** [November 8, 2016, 5:08pm UTC](https://forum.inductiveautomation.com/t/formatting-label-to-display-a-plc-tag-as-time/12333/2 "2016-11-08T17:08:58Z")

</div>

I would bind the int value to a custom property and then set the text when the property changes.

The code below should get you started with converting the integer value to the correctly formatted string. It handles integers less than 100,000 or \>= 100,000

`i = 112434
s = str(i)
print "%s:%s:%s" % (s[0:len(s)-4], s[len(s)-4:len(s)-2], s[len(s)-2:len(s)])`

---

<div class="post-metadata">

**Author:** ![Csantaw](https://avatars.discourse-cdn.com/v4/letter/c/9de0a6/32.png) [@Csantaw](https://forum.inductiveautomation.com/u/Csantaw)\
**Post date:** [November 8, 2016, 6:49pm UTC](https://forum.inductiveautomation.com/t/formatting-label-to-display-a-plc-tag-as-time/12333/3 "2016-11-08T18:49:13Z")

</div>

thanks for the help. I couldn’t get your method to work. but I found another way. I ran a gateway script which I listed below and wrote the time to a string tag and displayed that in the formatted text field box. works like a charm.`
Today = system.date.now()
Time = system.date.format(Today,"HH:mm:ss")
system.tag.write("Company/SAP/CIP_Wash_String",Time)`
