// // DSDateCategories.h // Shared categories // // Created by David Sinclair on Thu Apr 17 2003. // Copyright (c) 2003 - 2007 Dejal Systems, LLC. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // Redistributions of source code must retain this list of conditions and the following disclaimer. // // The name of Dejal Systems, LLC may not be used to endorse or promote products derived from this // software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR // PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE AUTHORS OR // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE // SOFTWARE OR THE USE OR OTHER DEALINGS IN THIS SOFTWARE. // #import @interface NSDate (DSDateCategories) + (NSDate *)carbonEpoch; + (NSDate *)dateWithCarbonDate:(unsigned long)carbonDate; - (unsigned long)carbonDate; - (NSCalendarDate *)convertToCalendarDate; - (NSString *)descriptionWithShortDateAndOrTime; - (NSString *)descriptionWithShortDateTime; - (NSString *)descriptionWithShortDate; - (NSString *)descriptionWithTime; @end // ---------------------------------------------------------------------------------------- #pragma mark - // ---------------------------------------------------------------------------------------- @interface NSCalendarDate (DSDateCategories) + (id)dateWithYear:(int)year month:(unsigned)month day:(unsigned)day; + (id)dateWithHour:(unsigned)hour minute:(unsigned)minute second:(unsigned)second; - (id)dateComponent; - (id)timeComponent; - (id)dateBySettingDateComponent:(NSCalendarDate *)value; - (id)dateBySettingTimeComponent:(NSCalendarDate *)value; @end