2010.03.17 NSDateを時分秒などに分解する方法 カテゴリ:iPhone SDK NSDateから時分秒などに分解するのに苦労しました。 なので忘れぬうちにメモしておきます。 NSDateComponents* components = [[NSCalendar currentCalendar] components: NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit fromDate:[NSDate date]]; NSInteger year = [components year]; NSInteger month = [components month]; NSInte