Display PLC Clock Time

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?

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

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.