|
-
Dec 13th, 1999, 06:28 PM
#1
Thread Starter
Junior Member
Hey!
I need some help with the code for a countdown clock. It's not for New Year's, it's for an event I am looking forward to in February 2000. I know I need to use the DateDiff function, but not sure on how to make it countdown the months, days, minutes, and probably seconds.
Any advice would be much appreciated!
Thanks,
Jeff
-
Dec 13th, 1999, 07:25 PM
#2
Drop a Timer control onto your form, change it's Interval property to 100. Also add a label to your form and use something like this:
Code:
Private mdatTimer As Date
Private Sub Form_Load()
mdatTimer = #2/15/2000# 'Set your date here
End Sub
Private Sub Timer1_Timer()
Dim sngSecs As Single
sngSecs = DateDiff("s", Now, mdatTimer)
Label1.Caption = Fix(((sngSecs / 60) / 60) / 24) & " Days, " & Fix((sngSecs / 60) / 60) Mod 24 & " Hours, " & Fix((sngSecs / 60)) Mod 60 & " Mins & " & (sngSecs Mod 60) & " Seconds until: " & Format(mdatTimer, "mmmm dd, yyyy")
End Sub
Regards,
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819
[This message has been edited by Serge (edited 12-14-1999).]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|