int main(int argc, char *argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; // // 現在時間を取得 : NSDate は不変クラス. // NSDate* nowDate = [NSDate date]; NSLog(@"base val %f, %@", [nowDate timeIntervalSinceReferenceDate], [nowDate description]); // クラスメソッドを使っても取得できる : 2001.1.1 からの時間. NSTimeInterval nowTime = [NSDate timeIntervalSinceReferenceDate]; // この値から、NSDate を復元できる. NSDate* retDate
![iPhone 現在時間を取得 - sehm @ メモ](https://cdn-ak-scissors.b.st-hatena.com/image/square/45c4684c76601e94abbe94966d9d5a26153b8fbd/height=288;version=1;width=512/https%3A%2F%2Fimg.atwiki.jp%2F_img%2Fog_image.png)