简体   繁体   中英

Timer countdown sql, asp.net c#

i have table with the desgin:

==========

id  (int, key)
itemName (nvarchar max)
offerClosing (datetime)

at the offerclosing i'm enter the date and time of the end of the offer to the item... example, now we at 16/5/2011 15:20 and the sale will end at 16:20, i want that at some lable will be timer countdown that will countdown one hour untill we get 16:20.

hope that's clearly and that possible.

I think when you load the page you should subtract the offerClosing time - Datetime.Now. Then you need to use javascript to subtract every second. This is similar to what Ebay does when an auction is nearing close. As far as the actual javascript I dont know offhand but I think you could google that

I'm assuming the countdown is displaying in a web browser. You'll want to write the countdown in javascript. Basically, store the offerClosing in a javascript variable and then use setTimeout with an interval of 1000ms (1s) to update the display of time remaining.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM