earlierDate:
二つの日付を比較して、より早い(過去の)日付を返します
-(NSDate *)earlierDate:(NSDate *)anotherDate:
解説
二つの日付を比較して、より早い(過去の)日付を返します。
返り値
( NSDate * )
時間
引数
( NSDate * )anotherDate
時間
フレームワーク
Foundation
クラス
NSDate
Instance Methods
使用可能
10.0
参照
- compare:
- isEqual:(NSObject protocol)
- laterDate:
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSDate *theDate1 = [NSDate dateWithString:@"2002-12-03 04:56:00 +0900"]; NSDate *theDate2 = [NSDate dateWithString:@"2002-12-04 04:56:00 +0900"]; NSLog([[theDate1 earlierDate:theDate2] description]); } @end