Thread: DateDiff in Month & Days format

  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    2

    DateDiff in Month & Days format

    Hi,

    How i can get date difference in Months and Days?

    Is there functions i can use to get this?

    I'm totally new to C.

    Thanks for anykind of help,

    Rwe

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    There's difftime() in time.h

    How are you representing your time values to begin with?
    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.

  3. #3
    Registered User
    Join Date
    Sep 2007
    Posts
    2
    I'm passing all six component idenpendantlay. Like M1, D1, Y1 and M2, D2, Y2

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    So you could call mktime() for those two times, then do a difftime() between them?
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can't Format C
    By caroundw5h in forum Tech Board
    Replies: 40
    Last Post: 04-26-2004, 09:57 AM
  2. Calculating days between two Dates
    By Niy in forum C++ Programming
    Replies: 9
    Last Post: 03-12-2002, 08:16 PM
  3. extending a month calander to a year
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 02-03-2002, 06:39 AM
  4. while, sentinel, if, switch
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 11-11-2001, 11:50 PM
  5. Pointers, arrays , functions
    By sballew in forum C Programming
    Replies: 19
    Last Post: 09-16-2001, 11:12 PM