Converting duration in seconds to time format

This is sample code. Add error handling and adjust to your requirements as necessary.

lnSeconds = 5678
&& The year and month are irrelevant here. The day should end on '0' if duration >= 24 hours
ltDt = {^2000/01/10 00:00:00} + lnSeconds
 
&& VFP 9.0 only
&& Time part only
? SUBSTR(TTOC(ltDt,3),12)
&& Days(0-9) + Time part 
? STRTRAN(SUBSTR(TTOC(ltDt,3),10), "T", " ")
 
&& Previous VFP versions
&& Time part only
? TRANSFORM( SUBSTR(TTOC(ltDt,1), 9), "@R 99:99:99")
&& Days(0-9) + Time part 
? TRANSFORM( SUBSTR(TTOC(ltDt,1), 8), "@R 9 99:99:99")