?
Solved

ASP.Net Countdown Timer VB.Net

Posted on 2013-06-23
3
Medium Priority
?
900 Views
Last Modified: 2013-08-03
Hi Experts,

I am looking for a count down timer that will count down for 1 year...

the way i want it to display is

Days remaining,  Hours, minutes, seconds

so, for example i want it to count down from 7th June 2013 to an event running on the 7th June 2014 at 13:30:00

I want it to show :

358 Days 15 hours 23 Minutes 15 minutes 23 Seconds

Any and all help would be very much appreciated... Ive not done anythign like this before and there are so many examples but in C# and not too clear...

thanks

Simon
0
Comment
Question by:SimonPrice33
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 27

Accepted Solution

by:
Sammy Ageil earned 2000 total points
ID: 39269971
if you are working with ASP.NET, you will need the timer in javascript. not VB or C#.
if you replace CONTROL_NAME_WHERE_COUNTER_TO_SHOW with the element you want the counter to show on, the script will show you the count down.


function CountToMyEvent() {
      now      =Date.parse("June 07, 2013 23:59:59");
      kickoff  = Date.parse("June 07, 2014 13:30:00");
      diff = kickoff - now;

      days  = Math.floor( diff / (1000*60*60*24) );
      hours = Math.floor( diff / (1000*60*60) );
      mins  = Math.floor( diff / (1000*60) );
      secs  = Math.floor( diff / 1000 );

      dd = days;
      hh = hours - days  * 24;
      mm = mins  - hours * 60;
      ss = secs  - mins  * 60;

        document.getElementById("CONTROL_NAME_WHERE_COUNTER_TO_SHOW")
            .innerHTML =
                dd + ' days ' +
                hh + ' hours ' +
                mm + ' minutes ' +
                ss + ' seconds';
}
setInterval('CountToMyEvent()', 1000 )

Credit: script adopted from http://nithinbekal.com/2009/javascript-how-to-create-a-simple-countdown-timer/

good luck
0
 

Author Comment

by:SimonPrice33
ID: 39275555
hi thanks for this i will take a look later this evening
0
 

Author Closing Comment

by:SimonPrice33
ID: 39379101
thank you
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

764 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