Convert seconds to HH MM SS

datetime should be usable, for Jython 2.5+:

from datetime import datetime, timedelta sec = timedelta(seconds=int(currentValue.value)) d = datetime(1,1,1) + sec hhmmss="%02d:%02d:%02d" % (d.hour, d.minute, d.second) system.tag.write("[.]remainHHMMSS", hhmmss)

This is nicely adjustable to use days as well:

from datetime import datetime, timedelta sec = timedelta(seconds=int(currentValue.value)) d = datetime(1,1,1) + sec ddhhmmss="%02d:%02d:%02d:%02d" % (d.day-1, d.hour, d.minute, d.second) system.tag.write("[.]remainDDHHMMSS", ddhhmmss)

For anyone wanting to play with this in the Script playground:

[code]from datetime import datetime, timedelta

s=500000

sec = timedelta(seconds=int(s))
d = datetime(1,1,1) + sec
print(“DAYS:HOURS:MIN:SEC”)
print("%02d:%02d:%02d:%02d" % (d.day-1, d.hour, d.minute, d.second))
[/code]