I am planning to save and manipulate time information in an iPhone application. Surprisingly I find very little discussion in searches regarding best practices in iOS.
My goal is to easily:
-calculate durations from start, finish, break fields.
-round entries by user selectable default increments (15 min, 30 min, etc.).
-sum, avg and graph the results as desired
My question is, what is the best way to save the time data? Do I save the full dates as NSDate? Do I parse out the time portion only?
Is the CFAbsoluteDate or CFInterval types a better way to go? These are alien to me, but search in Apple reference docs always seem to end up there. Unfortunately I see no example databases cited.
I can envision most of what I intend to do, but hoping for some pointers before I commit to a model one way or the other.
Unless you are extremely memory-constrained, NSDate is recommended. It has native time difference functions, which makes calculating time intervals as simple as: