Posted on 2004-11-13
Last Modified: 2010-04-03
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?
Question by:gmailrules
    LVL 16

    Accepted Solution


    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 :)
    LVL 6

    Assisted Solution

    startedTime = new Date();
    countDown = function(message){
          currentTime = new Date();
          elapsedTime = ( (currentTime.getTime()-startedTime.getTime())/60000 );
    timer = setInterval(countDown, 1000);

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
    I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
    The goal of the tutorial is to teach the user how to how to record live broadcast.
    The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now