clear Store DATETIME() TO datetime1 ? datetime1 WAIT WINDOW "Waiting 5 seconds" TIMEOUT 5 Store DATETIME() TO datetime2 ? datetime2 lnSeconds = ROUND( datetime1 - datetime2, 0) ? lnSeconds lndiff=SecToTime(lnSeconds) ?lndiff ? "shouldn't it return 0:00:05, not 0:59:55?" FUNCTION SecToTime * Convert seconds to the Time string PARAM nSeconds LOCAL cHH, nTm, cMM, cSec, cTime, i cHH = ALLT(STR(INT(nSeconds / 3600))) nTm = nSeconds % 3600 cMM = PADL(INT(nTm / 60), 2, "0") cSec = PADL(MOD(nTm, 60), 2, "0") cTime = cHH + ":" + cMM + ":" + cSec RETURN cTimeTIA,