Countdown

This is a discussion on Countdown within the C++ Programming forums, part of the General Programming Boards category; Im looking into doing a countdown program, does anybody know a good way to compare today's date and time to ...

  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
    Location
    Mt. Prospect, IL
    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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,334
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #4
    Banned
    Join Date
    Aug 2004
    Posts
    128
    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, 05: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21