Converting duration in seconds to time format
By Sergey - Posted on January 1st, 2008
| 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")
Recent comments
11 hours 9 min ago
1 week 22 hours ago
4 weeks 14 hours ago
5 weeks 5 hours ago
5 weeks 5 hours ago
7 weeks 4 days ago
8 weeks 1 day ago
8 weeks 1 day ago
8 weeks 4 days ago
8 weeks 4 days ago