Countdown to a date and time.

lcmoramos

New Member
How can a make a countdown to a date and time in the future.

I need to display how much days, minutes, hours and seconds until a certain date and TIME (ex. next sunday at 17:30).

I'm using this:

datainicial = DateParse(Date(Now))
datafinal = DateParse("29/01/2010")

t = datafinal - Now
segundos = Format((t Mod cTicksPerMinute)/cTicksPerSecond,"d2")
minutos = Format(Int((t Mod cTicksPerHour)/cTicksPerMinute),"d2")
horas = Int((t Mod cTicksPerDay)/cTicksPerHour)
dias = Int(t/cTicksPerDay)

lblDias.Text = Format(dias, "d2")
lblHoras.Text = Format(horas, "d2")
lblMinutos.Text = Format(minutos, "d2")
lblSegundos.Text = Format(segundos, "d2")

I just don't know how to put the time on it.
Thanks!!!
 
Last edited:
Top