Hi, I have a lottery script on my forum and I need to work out the next draw date based on todays date and the datetime field stored inthe database. So far I've got:
vblNextDrawDays = DateDiff("d", Now(), vblDrawsArray(1,0))
vblNextDrawHours = DateDiff("h", Now(), vblDrawsArray(1,0))
vblNextDrawMinutes = DateDiff("n", Now(), vblDrawsArray(1,0))
Next Draw in <%=vblNextDrawDays%> days <%=Abs(vblNextDrawHours)%> hours and <%=Abs(vblNextDrawMinutes) - Abs(vblNextDrawHours) * 60%> minutes
but it doesn't always work. Sometimes it's right and other times it's wrong (such as today the draw is at midnight tonight but it still says 1 day remaining).
Appreciate if you could help. Thanks
vblNextDrawDays = DateDiff("d", Now(), vblDrawsArray(1,0))
vblNextDrawHours = DateDiff("h", Now(), vblDrawsArray(1,0))
vblNextDrawMinutes = DateDiff("n", Now(), vblDrawsArray(1,0))
Next Draw in <%=vblNextDrawDays%> days <%=Abs(vblNextDrawHours)%> hours and <%=Abs(vblNextDrawMinutes) - Abs(vblNextDrawHours) * 60%> minutes
but it doesn't always work. Sometimes it's right and other times it's wrong (such as today the draw is at midnight tonight but it still says 1 day remaining).
Appreciate if you could help. Thanks