[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

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

Real time Timer and time left with count down

Hi

I need to program a real time timer like Current Golowbids Time at http://www.golowbids.com/featuredauction.php

The date and time is real time.

Secondly, Time Left is the count down from the END datetime.

I use repeater to get the end datetime from MSSQL.

<%# DataBinder.Eval(Container.DataItem, "enddatetime") %>

How should I make the count down with day, hour, min, second?

Thanks for advice.
0
techques
Asked:
techques
  • 2
1 Solution
 
CuteBugCommented:
0
 
techquesAuthor Commented:
how can the timer run itself? and how should I program the count down in comparing with the end datetime?  Is there any online tutorial or sample code? Is it javascript?
0
 
CuteBugCommented:
You can use the Timer Component
http://asp.net/AJAX/Documentation/Live/tutorials/IntroToTimerControl.aspx

For each tick of the Timer you can calculate the time left by using the DateTime.Subtract
http://msdn.microsoft.com/en-us/library/8ysw4sby.aspx

e.g. DateTime EndDate = new DateTime(2008, 11, 7, 22, 15, 0);
DateTime diff = EndDate.Subtract(DateTime.Now);

Display the diff.
0

Featured Post

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

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