Thread: number of hours between 2 dates

  1. #1
    Registered User
    Join Date
    Jun 2004
    Posts
    2

    number of hours between 2 dates

    hi everyone,

    i am not been able to calculate the number of hours between 2 dates, but there is a condition that 2 days of the week are off (not working hours i.e. saturday and sunday), so these two days shud not be included.

    i am a newbie in C language, plz help me with the code.

    Thanks alot
    Gaurav

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Doo Doo Deet. We're sorry, you have made a post that is invalid, and help for you is no longer an option. If you feel you have reached this recording in error, please read the Announcements and try your post again.

    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Registered User linuxdude's Avatar
    Join Date
    Mar 2003
    Location
    Louisiana
    Posts
    926
    just think how would you do it real life. Figure out how many days are in each month. then count all the days until you get to the specified date.

  4. #4
    Registered User
    Join Date
    May 2004
    Posts
    12
    start learning by reading a book. HINT: You have to use time.

  5. #5
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    You don't have to use the time functions. You can simply ask for two dates, figure out how many days there are, multiply by 24. They never said anything about counting the exact number of hours based on the time in each day. So you get to assume they mean entire days worth.

    Quzah.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Issue w/ Guess My Number Program
    By mkylman in forum C++ Programming
    Replies: 5
    Last Post: 08-23-2007, 01:31 AM
  2. Time between Military Hours
    By StarOrbs in forum C++ Programming
    Replies: 18
    Last Post: 03-01-2005, 06:46 PM
  3. number of days between 2 dates.
    By explosive in forum C++ Programming
    Replies: 10
    Last Post: 02-17-2005, 07:30 AM
  4. C++ number of days between 2 dates?
    By Rain1522 in forum C++ Programming
    Replies: 1
    Last Post: 03-13-2002, 09:09 PM
  5. Random Number problem in number guessing game...
    By -leech- in forum Windows Programming
    Replies: 8
    Last Post: 01-15-2002, 05:00 PM