Is there a command to display number of seconds as hrs:min:seconds?

Terry Judd terry.judd at unimelb.edu.au
Wed Oct 16 20:41:24 EDT 2019


Not built-in but...

function formatRemainingTime pTime
   put trunc(pTime/3600) into tHours
   put pTime mod 3600 into tTimeX
   put trunc(tTimeX/60) into tMins
   put tTimeX mod 60 into tSecs
   if tHours < 10 then put "0" before tHours
   if tMins < 10 then put "0" before tMins
   if tSecs < 10 then put "0" before tSecs
   return tHours&":"&tMins&":"&tSecs
end formatRemainingTime

On 17/10/19, 11:24 am, "use-livecode on behalf of Bill Vlahos via use-livecode" <use-livecode-bounces at lists.runrev.com on behalf of use-livecode at lists.runrev.com> wrote:

    I’m writing a countdown timer application and want to display the remaining time not as the number of seconds but in the format of HR:MIN:SEC left.
    
    For example 75 seconds would display as “0:1:15”.
    130 seconds would display as “0:2:10”.
    
    I know how to do the math to figure it out but I’m wondering if there is a built in function to do this.
    
    Convert wants to deal with actual time so I would get something like “0:1:15 PM”.
    
    Thanks,
    Bill Vlahos
    _______________________________________________
    use-livecode mailing list
    use-livecode at lists.runrev.com
    Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
    http://lists.runrev.com/mailman/listinfo/use-livecode
    
    



More information about the use-livecode mailing list