sd_dracula
sd_dracula

Reputation: 3896

sql 2008 r2 countdown timer

I have a column in my table called TimeLeft of type datetime, days:hours:minutes (ie: 1:12:30 for 1 day 12h 30 mins)

What I need to do is pull this data via an .net page page and I need it to countdown in realtime from the time it was entered until 0.

Also what datatype should I use if I want to represent just dd:hh:mm in a column (ie: 07:00:00 would be 7 days)

How to go about doing just that?

Upvotes: 1

Views: 344

Answers (1)

Peter
Peter

Reputation: 27944

You should not save the current countdown time, but the endtime for the countdown. Then calculate the time left before the endtime. This will give you the countdowntime.

Upvotes: 2

Related Questions