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

Try this:

if(
	isNull({[~]Tag}),
	"0:00:00",
	stringFormat(
		"%02d:%02d:%02d",
		toInt(floor({[~]Tag}/3600)),
		toInt(floor({[~]Tag}%3600/60)),
		toInt(floor({[~]Tag}%60))
	)
)

If your float value is too large the first value will have more than 2 digits.

3 Likes