# Flv Video - duration and time

**URL:** https://forum.kirupa.com/t/flv-video-duration-and-time/224449
**Category:** flash
**Created:** [May 2, 2007, 2:58pm UTC](https://forum.kirupa.com/t/flv-video-duration-and-time/224449 "2007-05-02T14:58:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![bigbstanley](https://avatars.discourse-cdn.com/v4/letter/b/977dab/32.png) [@bigbstanley](https://forum.kirupa.com/u/bigbstanley)
#### Post date: [May 2, 2007, 2:58pm UTC](https://forum.kirupa.com/t/flv-video-duration-and-time/224449/1 "2007-05-02T14:58:52Z")

</div>

Just thought I’d post this to the forum for anyone doing flv video players. It’s code that I wrote to show the video playhead time next to the complete video time (00:42/4:38 format)

Thought it might help a lot of people.

```auto

myVideo.onEnterFrame = function() {
    minutes = Math.floor(myVideo.playheadTime/60);
    seconds = Math.floor(myVideo.playheadTime%60);
    totaltimeMin = Math.floor(myVideo.totalTime/60);
    totaltimeSec = Math.floor(myVideo.totalTime%60);
    
    timer = ((minutes>=10) ? minutes : "0"+minutes) + ":" + ((seconds>=10) ? seconds : "0"+seconds) + " / "+ ((totaltimeMin>=10) ? totaltimeMin : "0"+totaltimeMin) + ":" + ((totaltimeSec>=10) ? totaltimeSec : "0"+totaltimeSec);
    trace(timer);
}

```
