A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: seconds (1234567) to time (00:00:00)

  1. #1
    Member
    Join Date
    May 2003
    Posts
    72

    seconds (1234567) to time (00:00:00)

    hello everyone.

    need a function for converting an amount of seconds
    to time format.

    eg:
    second=65

    timeformat="00:01:05"

    thanks all.

    piny
    expect the unexpected.
    that's what mx is all
    about.

  2. #2
    Member
    Join Date
    May 2003
    Posts
    72

    resolved:

    thanks but the problem solved.


    if anyone intrested here is the code:


    TimeConvert = function(Seconds){
    HOURS=Math.floor(Seconds / 3600)
    minutes=Math.floor((Seconds / 3600 - HOURS) * 60)
    tseconds=Math.round((((Seconds / 3600 - HOURS) * 60) - minutes) * 60)
    if(length(HOURS) eq 1 ){HOURS = "0" add HOURS}
    if(length(minutes) eq 1 ){minutes = "0" add minutes}
    if(length(tseconds) eq 1 ){tseconds = "0" add tseconds}
    return (HOURS add ":" add minutes add ":" add tseconds)
    }

    newtime=TimeConvert(6000);



    regards
    piny
    expect the unexpected.
    that's what mx is all
    about.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center