DateTools was written to streamline date and time handling in iOS. Classes and concepts from other languages served as an inspiration for DateTools, especially the DateTime structure and Time Period Library for .NET. Through these classes and others, DateTools removes the boilerplate required to access date components, handles more nuanced date comparisons, and serves as the foundation for entirely new concepts like Time Periods and their collections. All the classes required for DateTools are located in the DateTools folder in the root of this repository. DateTools.h contains the headers for all the other files. Import this if you want to link to the entire framework. One of the missions of DateTools was to make Date feel more complete. There are many other languages that allow direct access to information about dates from their date classes, but Date (sadly) does not.
Features
- The date editing methods in DateTools makes it easy to shift a date earlier or later by adding and subtracting date components
- Another mission of the DateTools category is to greatly increase the flexibility of date comparisons
- The new methods are isEarlierThan, isEarlierThanOrEqualTo, isLaterThan, and isLaterThanOrEqualTo
- Date comes with two methods timeIntervalSinceDate: and timeIntervalSinceNow which gives you a double offset representing the number of seconds between the two dates
- DateTools goes back to the ever-trusty NSCalendar and abstracts out all the necessary code for you
- DateTools has a few convenience methods for quickly creating strings from dates