View the time remaining smart

Hello!

To recognize the users of my site on the remaining duration of their sessions, I display a countdown in seconds.

But it's not very smart...

How can I display the remaining time in minutes and seconds?

(the sessions are limited to 30 minutes)

Type of display I want to use: 16:39

This is the code I use:

County = 1800;

myCountDown = function () {}

County;

};

countInterval = setInterval (myCountDown, 1000);

onEnterFrame = function () {}

countDownFld.text = count;

If (count == 0) {}

clearInterval (countInterval);

< action >;

< some another action >;

}

};

Thank you very much in advance for your help!

If you have seconds and that you want to display the minutes and the seconds, and then you do a little math.  If you divide the number of seconds by 60 you get the number of minutes.  If you take the module of the 60-second, you get the number of seconds.  So just use these two calculations to ge6t minutes and seconds and display them in a textfield.

var minutes = Math.floor (count/60);

var seconds = number % 60;

countDownFld.text = String (minutes) + ":" + String (second);

and if you want to display zeros, you can do a conditional check to see if the numbers are< 10="" and="" append="" them="" to="" a="" "0"="" if="">

If (seconds< 10)="" seconds="0" +="">

Tags: Adobe Animate

Similar Questions

  • Need to know the time remaining for the battery charge/discharge

    Hello

    I want to know the time remaining for a battery charge or discharge. I tried battery_info_get_time_to_empty() but it does not return a correct value. Can anyone help?

    This topic is already discussed in this thread:

    http://supportforums.BlackBerry.com/T5/native-development/some-help-with-battery-info/m-p/2240449#M1...

  • How to display the time remaining to Oracle ADF

    I use Jdeveloper 11.1.1.6

    I need to show the time remaining on the top of my page.

    My application is as a kind of quiz thing. so, I need indicate the time remaining on the top of the page.

    I tried to use Javascript, it does not work on fragments of the page.

    is there a possible way to apply the same thing to my application.

    Thank you

    NGO

    Post edited by: Naresh_ADF

    Java script:

    var s = 10;

    var min = 00;

    var h = 00;

    function countDown() {}

    s-- ;

    If (s ==-01) {}

    SEC = 59;

    min = min - 1; }

    else {}

    min = minutes; }

    If (sec<=9) {="" sec="0" +="" sec;="">

    time = hour + ":" + (min<=9 "0"="" +="" min="" :="" min)="" +="" "="" :="" "="" +="">

    If (document.getElementById) {document.getElementById('timerText').innerHTML = time ;}

    SD = Window.setTimeout ("countDown ();', 1000");

    If (min == '00' & s == '00') {s = "00"; window.clearTimeout (SD) ;}}

    }

    Window.OnLoad = count;

    JSPX page and does not work for fragments.

    Thank you

    NGO

  • How to view the "timer" current user time

    Hello

    How to display the "timer" right now?

    Currently I have in my program using timer, how to display the current time left on the timer to warn the user the time left on the timer?

    The number of timer upward or the countdown?

    using TimerCB

    a Council does

    Thank you

    Ben

    I'm not aware of the possibility of obtaining the hour up to what a timer callback will be called, then I would say a different approach:

    If, say, you want some action to happen every 10 minutes, but I would like to update the user interface of every second indicating the remaining time I would set the timer to 1 s interval. In the reminder of the timer, I would use a setting that is incremented each time the callback is called; If this value reaches 60 x 10 I reset the parameter and call the function to get the job done. In all other cases, you can simply view 600 - setting (in seconds) than the rest of the time.

    An alternative may be to use two counters, one for the action, called every 10 minutes, and one for the update of the UI, called say every second...

  • I have problems with my computer with the time remaining after I reset the clock and made sure it was on the correct time zone and summer time has been check the battery has also been replaced

    and it will not keep the exact time it will keep accelerate at least 5 minutes or more.

    I don't know what else to do about it. You can someone help me?

    I still find myself make too many assumptions.
    First of all, I guess your derivative of clock occurs during the time when the computer is running and not during the period where it is off (or immediately early)?
    Second, I'm assuming that when you run the command "w32tm/Resync" above, the clock made it back to the correct time and no errors were reported?
    Third, you say that your clock drift 5 minutes or more, but you do not tell us how long this gain occurs.  It is two times more win if you wait twice as long to check?  Is the gain gradual or sudden?  Keep he wins or if he stops wins once it arrives before?

    Conditions of default for a computer connected non-member of the field, the time will be updated network-time only at the start and then once a week.  If you are winning too much too quickly, you can adjust how many times your computer asks for time.  Computers in the domain must be more precise and one every hour for a default time synchronization.  You can set your W32tm to that of a computer in the domain to resynchronize your computer more often (SpecialPollInterval).  Here are two articles that describe the clock settings:

    "How to synchronize the time with the time service Windows in Windows XP"
      <>http://support.Microsoft.com/kb/307897 >
    "Time Windows Services tools and settings.
      <>http://TechNet.Microsoft.com/en-us/library/cc773263%28V=WS.10%29.aspx >

    HTH,
    JW

  • How to check the time remaining on the process to gather stats.

    I see how much time it will take to collect statistics.

    Thank you

    Published by: vhiware on February 12, 2010 16:03

    query V$ SESSION_LONGOPS

  • Satellite A500 does not show 'time remaining' for the battery

    I just bought Satellite A500 with Windows 7 and I noticed one thing, it is that there is no "remaining time" for the battery?

    My former use A100 to display the time remaining on the power but not Windows 7, all I get is a remaining percentage... makes it go for all of the A500 running windows 7 or is - it something wrong with my new computer?

    I guess that the Win 7 drivers should be released in the near future, it seems that Toshiba is driver downloading
    Then maybe after the driver version complete you will get this battery notification allows you to see how it will work

  • TIME REMAINING IN SECONDS FROM THE END OF THE MONTH

    Dear all,

    How to calculate the time remaining is seconds to the end of the month?

    time difference in seconds of sysdate to the last day of the month till 23:59:59

    Thanks in advance

    Hello

    SELECT (ADD_MONTHS (TRUNC (SYSDATE, 'MONTH')

    1

    )

    -SYSDATE

    ) * 24 * 60 * 60 AS seconds_left

    DOUBLE;

    SYSDATE is the date and time.

    TRUNC (SYSDATE, 'MONTH') is the beginning of the current month

    ADD_MONTHS (TRUNC (SYSDATE, 'MONTH'), 1) is the beginning of the next month

    ADD_MONTHS (TRUNC (SYSDATE, 'MONTH'), 1)-SYSDATE is the number of days (not necessarily an integer) by the end of the month

    (ADD_MONTHS (TRUNC (SYSDATE, 'MONTH'), 1)-SYSDATE) * 24 is the number of hours (not necessarily an integer) by the end of the month

    ...

  • Is it possible to keep the timer "always on top"?

    When you use the timer I like to keep the timer of disappearing from the screen saver, but I didn't understand how to do... If that's possible.  After the timer starts, he goes down to a few seconds and the clock face appears again.  To check the time remaining on the timer, you must click to the home screen and select new application timer... which, in few seconds again goes to the background and the face of the clock reappears, again he must open the clock app to see the remaining time.  If there is a way to keep the timer "on-top" without having to repeatedly touch the screen during execution of the timer, I have not discovered.  I would also add the timer to my eyes so I can toggle to him as well.  Of course, I can do it on my iPhone, but the Watch has not yet this ability.  Apple engineers could make sure with the timer and the timer if they see the need.  Are there others who want that ability as well?  I think so.

    Hello

    It is not currently possible to add Timer looks. However, your watch can be configured for more convenient use of the application of the timer:

    • Set your watch to return to the last app used to raise your wrist:
      • On your iPhone, in the application of the watch, go to: Watch My > General > wrist Detection - turn on.
      • On your iPhone, in the application of the watch, go to: Watch My > General > screen Wake:
        • Raise the topic on the wrist, select RESUME last activity.

    After you start a timer by opening the timer app, your watch will return to timer (for as long it remains the last app used) when you then lift your wrist.

    • Add a Timer to your dial of the watch as a complication. When you view the time on your watch:
      • Firmly press the display > drag left / right to the face of the watch you want to customize (not to slip if you want to customize the current face of the watch).
      • Press the Customize button.
      • Some watch faces offers more than one screen customization options > move left until you reach the last screen to select (if available) complications.
      • Tap a complication to customize what is shown in this place.
      • Turn the digital Crown to scroll through available there complications until you reach Timer.
      • Press the digital Crown, then press the dial to return.

    To start the timer directly from your watch dial, press the complication. Once started, the remaining time will be then showed complication on your watch until the end of the timer dial, when the application opens for you to make them disappear.

  • How to reset the time to 0:0 seconds to 1 Bar?

    I don't know what I did in my project, but somehow my scale of time lag between my rule of measure.

    The time remains just 0:0 until the playhead reaches 20 Bar of the project then starts counting from 0 there.

    Can someone please tell me how this happens and how to reset so the time progressive count between 0 seconds starting at 1 Bar (instead of starting at 20 Bar as shown)?

    Thanks in advance!

    See below... This should solve your problem...

  • How can I view the timestamps of text on an iPhone 5 c

    On my 5 c 9.3.1 running iPhone, outgoing text messages display a timestamp. Incoming messages only. How can I view the time stamp on incoming messages?

    It is displayed at the top of the first post of the series

  • Satellite A200 - I can't see battery time remaining single percentage

    Hello

    I had a Satellite A200 on Vista and XP, and I'm NOT able to see the remaining estimated battery time. I see only the percentage left.

    For example, I use my laptop unplugged for over an hour (my comments) and I can only see the percentage left (45%), but I can't see the time remaining.

    I have a problem with Vista or XP.

    Is - this natural? What can I do to see the time remaining?

    Thank you

    Diego Alvares
    Brazil

    Sorry, but I would like to know why you think that this is a problem. Where you found information that it must be demonstrated to remaining battery time?

  • After 4.4 my Batt. / hour and the signal remained blue

    After the update to 4.4 KitKat on my Droid Maxx I noticed that my battery, signal and the time remained blue? I know the KitKat update was supposed to bring the white/gray color to the notifications/status bar. I saw another comment on that person. My update Nexus 7 removed the blue and update of bike G my kidnapped son to 4.4.2 blue also. Not a major problem but a question of aesthetics.

  • final value of the timer

    Hello

    I have a few problems to store the timer values and appreciate all the help I can get.

    Set the backround: to collect interval data (time, count) between packets on an assembly.

    Needs of: count the number of packets and view the time between packets.

    My problem is that when I save to spreadsheet each incriment stuck time power is saved. This could lead to a large number of unnecessary data points. Instead, I want only the last zero no value of the glued power saved timer.

    Any help is greatly appreciated.

    ~ Modi


  • I just bought my hp pc Pavilion g series, but many times not dΘmarre; the screen remains black or blue and must strive to market several times. What is going on?

    When I turn off my pc and that you want to turn it back on, it does not work and the screen remains black or blue, sometimes but nothing else and does not

    starts up, until I have try several times in pushing and disable the power button and suddenly starts working again. The pc is almost brand new (2 weeks)

    What is going on?  Thank you very much

    Hello

    I suggest you do the repair of the system startup and check if that helps resolve the issue.

    Check the link for more information on repair system below.

    Startup Repair

    http://Windows.Microsoft.com/en-us/Windows7/products/features/Startup-Repair

    You can also check the event viewer for more information on the error message.

    Open event viewer

    http://Windows.Microsoft.com/en-us/Windows7/open-Event-Viewer

    See also:

    Resolve stop (blue screen) errors
    http://Windows.Microsoft.com/en-us/Windows7/resolving-stop-blue-screen-errors-in-Windows-7

Maybe you are looking for

  • IMovie 10 does support AppleScript these days?

    Before that I spend my meager $20 on iMovie (Yes, I know this is trivial, but I already use Avid, first, determination and sometimes FCP X, I do not need an editing application) can someone tell me if she accepts AppleScript? I need to be able to cho

  • Question about Bluetooth and version license

    I have a license for the Toshiba Bluetooth Stack.My laptop is Equium P300-16 tI downloaded the new version 8.00.03 and extract the file inside was version 7.10.18.It's true!

  • Satellite L750-11W - DVD rom doesn't read any DVD

    The problem is very annoying, that the dvd rom is not reading my dvd; I tried to install a game on a dvd but it doen't want to read it, I have, but another dvd (different game) and it read; the two DVD works on other laptops (I checked) DVDs are not

  • generator of vision

    HelloI need to make a zoom in and zoom out in an acquired image that I show in my Vision Builder I-Inspection, but the problem is that there is no command button in my graphical user interface that allows me to do. I know that it is possible to have

  • Taskkill Creative cloud background deals?

    Hi allI sometimes run resource intensive applications (for example, audio editing, 3D rendering) on my Workstation Windows 10 and, for optimization, prefer to disable all unnecessary applications.  Adobe installs several applications of background cr