Results 1 to 4 of 4

Thread: Countdown Clock

  1. #1

    Thread Starter
    New Member
    Join Date
    May 1999
    Location
    UK
    Posts
    1
    Could somebody please help me, i'm trying to create a countdown clock that will countdown months, days, hours, minutes, seconds to a specific time. I have tried thinking of ways to do it but i couldn't come up with any.

    Many thanks.

  2. #2
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544
    I found the following code in the VB help file...hope you can use it:

    Code:
    MyTime and MyDate are displayed in the development environment using current system short time setting and short date setting.
    
    Dim MyTime, MyDate, MyStr
    MyTime = #17:04:23#
    MyDate = #January 27, 1993#
    
    ' Returns current system time in the system-defined long time format.
    MyStr = Format(Time, "Long Time")
    
    ' Returns current system date in the system-defined long date format.
    MyStr = Format(Date, "Long Date")
    
    MyStr = Format(MyTime, "h:m:s")   ' Returns "17:4:23".
    MyStr = Format(MyTime, "hh:mm:ss AMPM")   ' Returns "05:04:23 PM".
    MyStr = Format(MyDate, "dddd, mmm d yyyy")   ' Returns "Wednesday,
       ' Jan 27 1993".
    ' If format is not supplied, a string is returned.
    MyStr = Format(23)   ' Returns "23".
    
    ' User-defined formats.
    MyStr = Format(5459.4, "##,##0.00")   ' Returns "5,459.40".
    MyStr = Format(334.9, "###0.00")   ' Returns "334.90".
    MyStr = Format(5, "0.00%")   ' Returns "500.00%".
    MyStr = Format("HELLO", "<")   ' Returns "hello".
    MyStr = Format("This is it", ">")   ' Returns "THIS IS IT".
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

  3. #3
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    you can do it with the DateDiff Function. but as for the way you want a countdown clock to work, i have had some trouble. it involves the Mod operator, but as you need the time, results are not correct. some if.then logic will be required to stablize it, but i'm too busy to do it now. Sorry.
    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

  4. #4
    Fanatic Member
    Join Date
    Nov 2000
    Location
    Sydney Australia
    Posts
    804
    See attached.
    Attached Files Attached Files

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