Solved

ASP.Net Countdown Timer VB.Net

Posted on 2013-06-23
3
826 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
  • 2
3 Comments
 
LVL 27

Accepted Solution

by:
Sammy earned 500 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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
TimeZone, day light savings, Sql server, asp.net 6 37
Add or delete table rows 10 53
Need help Creating PowerShell Script 5 53
reading excel file in .net 2 14
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

808 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