seconds to standard time numberformat?

Monte Goulding monte at sweattechnologies.com
Fri Aug 22 18:58:00 EDT 2003


Hi

You've had quite a number of solutions but here's another one:

-- function to return the the time format (h:mm:ss) from an input in seconds
function timeFormat timeInSecs
  if timeInSecs = 0 then
    put "0:00:00" into timeInForm
  else
    put format("%1d:%2d:%2d", timeInSecs div 60 div 60, timeInSecs div 60
mod 60, timeInSecs mod 60) into timeInForm
    repeat with x = 1 to the number of chars of timeInForm
      if char X of timeInForm is space then
        put 0 into char X of timeInForm
      end if
    end repeat
  end if
  return timeInForm
end timeFormat

Cheers

Monte

>
> Is there a numberformat or other option that will display seconds in
> standard 00:00:00 format?
>
> I've got a "send to me in 1 second...add 1 to field theTime" scenario
> going on a project, and would like the result to display in standard
> form, rather than raw seconds.  What's the most efficient way to make
> this happen?
>
> Thanks
> Mark
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>




More information about the use-livecode mailing list