APp to o calculate number of days between two dates

Discussion in 'iPhone/iPad Programming' started by pranavrshah2006, Nov 26, 2012.

  1. macrumors newbie

    Joined:
    Nov 26, 2012
    #1
    Hello
    I am looking to develop an app for calculating no of days between two dates.
    Can somebody pls provide me some algo or some reference link or pseudocode?
    Thanks:)
     
  2. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
  3. ArtOfWarfare, Nov 26, 2012
    Last edited: Nov 26, 2012

    macrumors 603

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #3
    In addition to NSDate to find the time interval between two dates, you'll also want to use an NSDatePicker so that the user can input two dates:

    http://developer.apple.com/library/ios/documentation/uikit/reference/UIDatePicker_Class/

    Finally, some basic knowledge about how integer division and modulus work so that you can convert the time interval to seconds, minutes, hours, and days will help... Unless UIKit happens to have a method that does that already built in? I'm not sure which class would hold such a method...
     
  4. macrumors 68030

    MattInOz

    Joined:
    Jan 19, 2006
    Location:
    Sydney
    #4
    Don't forget to add a little button that includes or excludes the final day.
     
  5. macrumors 6502a

    Joined:
    Jun 14, 2012
    Location:
    Columbia, MD
    #5
    This is very suspect of a class assignment. ;)
     

Share This Page