Thread: Countdown

  1. #1
    Registered User
    Join Date
    Sep 2003
    Posts
    15

    Countdown

    Im looking into doing a countdown program, does anybody know a good way to compare today's date and time to the desired date and time and give the difference in days, hours, minutes, and seconds? such as: its now Sep 26 10:50 AM, it is X days, X hours, X mintues, and
    X seconds until Nov 21 10:00 AM
    I am the Uber Noob

  2. #2
    Registered User axon's Avatar
    Join Date
    Feb 2003
    Posts
    2,572
    I believe this has been asked before on these forums, please do a search.

    some entropy with that sink? entropysink.com

    there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    difftime() tells you the number of seconds between two date-times
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #4
    go to www.cplusplus.com

    and look at time.h

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Day countdown
    By putty88 in forum C Programming
    Replies: 5
    Last Post: 02-15-2009, 06:55 PM
  2. The countdown has begun (StarWars)
    By Magos in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 05-12-2005, 09:08 AM
  3. Replies: 4
    Last Post: 08-13-2003, 07:25 PM
  4. delay()?/sleep()?/need for countdown/
    By Robin Hood in forum C++ Programming
    Replies: 2
    Last Post: 07-19-2002, 04:04 PM
  5. Whats wrong with my countdown program?
    By Golden Bunny in forum C++ Programming
    Replies: 3
    Last Post: 04-23-2002, 01:15 PM