Results 1 to 2 of 2

Thread: Countdown Clock

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 1999
    Location
    Turner ME USA
    Posts
    18

    Post

    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

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    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
  •  



Click Here to Expand Forum to Full Width