APp to o calculate number of days between two dates

Discussion in 'iOS Programming' started by pranavrshah2006, Nov 26, 2012.

  1. pranavrshah2006
    Expand Collapse
    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. ArtOfWarfare, Nov 26, 2012
    Last edited: Nov 26, 2012

    ArtOfWarfare
    Expand Collapse
    macrumors 604

    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...
     
  3. MattInOz
    Expand Collapse
    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.
     
  4. phr0ze
    Expand Collapse
    macrumors 6502a

    Joined:
    Jun 14, 2012
    Location:
    Columbia, MD

Share This Page