Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 217
  • Last Modified:

time

I am getting a DateTime value from a mysql database and want to be able to display the time elapsed in flash since the retrieved time, in minutes.  How could I accomplish this?
0
gmailrules
Asked:
gmailrules
2 Solutions
 
vickerleungCommented:
gmailrule,

You can do in this way.

When you just receive the data from the database retrieval
Make a new date time object and mark down the time

loadVars object.onData = function ()
{
     mark_time = new Date ();
     mark_utc = mark_time.getTime ();
}

And then when you want to know the elapsed time in certain part of the movie
Just make another date time object and compare with the marked one

now_time = new Date ();
now_utc = now_time.getTime ();

trace ((now_utc - mark_utc) / 60000);

Vicker :)
0
 
nishasrilankanCommented:
startedTime = new Date();
elapsedTime;
countDown = function(message){
      currentTime = new Date();
      elapsedTime = ( (currentTime.getTime()-startedTime.getTime())/60000 );
                trace(elapsedTime);
      }
timer = setInterval(countDown, 1000);
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now