# Display PLC Clock Time

**URL:** <https://forum.inductiveautomation.com/t/display-plc-clock-time/2778>\
**Category:** Ignition\
**Created:** [March 18, 2011, 8:43pm UTC](https://forum.inductiveautomation.com/t/display-plc-clock-time/2778 "2011-03-18T20:43:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rooks](https://avatars.discourse-cdn.com/v4/letter/r/ce7236/32.png) [@rooks](https://forum.inductiveautomation.com/u/rooks)\
**Post date:** [March 18, 2011, 8:43pm UTC](https://forum.inductiveautomation.com/t/display-plc-clock-time/2778/1 "2011-03-18T20:43:16Z")

</div>

I am trying to display the current time from a PLC’s RTC on a window. The PLC is a MIcroLogix 1100. I have created sql tags that are reading the PLC Clock’s Year, Month, Day, Hour, Minute, Seconds as integers. I want to display this information on a window in this format “YYYY-MM-DD HH:MM:SS”. Any suggestions?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [March 18, 2011, 11:04pm UTC](https://forum.inductiveautomation.com/t/display-plc-clock-time/2778/2 "2011-03-18T23:04:55Z")

</div>

Well, this is a bit of a hack, but here goes; bind the value property of a label to the following expression:

```auto
stringFormat("%s-%s-%s %s:%s:%s",
	numberFormat({year_tag}, "0000"),
	numberFormat({month_tag}, "00"),
	numberFormat({day_tag}, "00"),
	numberFormat({hour_tag}, "00"),
	numberFormat({minute_tag}, "00"),
	numberFormat({second_tag}, "00")
)
```

This assumes you have 7.2.4 installed, as I don’t think the stringFormat() function was available prior.
