Skip to content

Instantly share code, notes, and snippets.

@haikusw
Created June 1, 2011 21:37
Show Gist options
  • Save haikusw/1003386 to your computer and use it in GitHub Desktop.
Save haikusw/1003386 to your computer and use it in GitHub Desktop.
debugging aid for dates
#import <Foundation/Foundation.h>
@interface NSDateComponents (HSINSDateUtils)
- (void) logToConsole;
@end
@implementation NSDateComponents (HSINSDateUtils)
- (void) logToConsole
{
NSLog(@"DateComponents: %@. \n \tera: %d \n \tyear: %d \n \tmonth: %d \n \tday: %d \n \thour: %d \n \tminute: %d \n \tsecond: %d \n \tweek: %d \n \tweekday: %d \n \tweekdayOrdinal: %d \n", self, [self era], [self year], [self month], [self day], [self hour], [self minute], [self second], [self week], [self weekday], [self weekdayOrdinal] );
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment