Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Nov 26, 2012, 05:57 PM   #1
pranavrshah2006
macrumors newbie
 
Join Date: Nov 2012
APp to o calculate number of days between two dates

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
pranavrshah2006 is offline   0 Reply With Quote
Old Nov 26, 2012, 05:58 PM   #2
dejo
Demi-God (Moderator)
 
dejo's Avatar
 
Join Date: Sep 2004
Location: Colorado
NSDate Class Reference
__________________
My iOS Apps: a.k.a., DreamStream
I support the MacRumors Blood Drive!
dejo is offline   0 Reply With Quote
Old Nov 26, 2012, 06:39 PM   #3
ArtOfWarfare
macrumors 68040
 
ArtOfWarfare's Avatar
 
Join Date: Nov 2007
Send a message via Skype™ to ArtOfWarfare
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...

Last edited by ArtOfWarfare; Nov 26, 2012 at 06:44 PM.
ArtOfWarfare is offline   0 Reply With Quote
Old Nov 26, 2012, 11:26 PM   #4
MattInOz
macrumors 68020
 
MattInOz's Avatar
 
Join Date: Jan 2006
Location: Sydney
Don't forget to add a little button that includes or excludes the final day.
__________________
There is no such thing as "Collective Wisdom"
[13" MacBookPro 2.7Ghz, 27"Al iMac i7, Black MacBook 13", iPhone 4, iPad]
MattInOz is offline   0 Reply With Quote
Old Nov 29, 2012, 01:51 PM   #5
phr0ze
macrumors 6502
 
Join Date: Jun 2012
Location: Columbia, MD
This is very suspect of a class assignment.
__________________
2012 11" MBA i7/8/256
2011 Mac Mini with 27" Thunderbolt Display
Black iPad Mini 32GB Verizon
Black iPhone 5 32GB ATT
phr0ze is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 05:48 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

Privacy / DMCA contact / Affiliate and FTC Disclosure
Copyright 2002-2013, MacRumors.com, LLC