Skip to main content
Inspiring
May 30, 2006
Question

Converting SECS (0306) in to Time (5:06)

  • May 30, 2006
  • 2 replies
  • 322 views
I am trying to build a script that will convert SECONDS into HH:MM:SS, as in a duration for a song. I am able to supply the number of seconds in 4 digits... e.g. 0306 (which equals 5:06).

Can someone help with a script? I will need hours, minutes, seconds.

Thanks
Geoff
This topic has been closed for replies.

2 replies

Inspiring
May 30, 2006
The leading zero indicates an octal number. Flash converts the value to
decimal.

Assuming 0306 is a string, use parseInt("0306",10);


"GmR" <webforumsuser@macromedia.com> wrote in message
news:e5h5lb$quc$1@forums.macromedia.com...
> Ahha -- I discovered a cause of my problems...
>
> When 0306 is converted to an integer it becomes 198.
>
> trace (int(0306) ); // =198
>
> Why is this? How can I convert 0306 to 306?
>
> Thanks
> Geoff
>


GmRAuthor
Inspiring
May 30, 2006
Ahha -- I discovered a cause of my problems...

When 0306 is converted to an integer it becomes 198.

trace (int(0306) ); // =198

Why is this? How can I convert 0306 to 306?

Thanks
Geoff