| Home 目次>Foundation>NSDate このサイトはこちらに移転しました。 | |
timeIntervalSinceReferenceDate
グリニッジ標準時の2001年1月1日0時0分0秒と現在との差を秒数で返します
+(NSTimeInterval) timeIntervalSinceReferenceDate
【返り値】 | |
| NSTimeInterval | 時間間隔 |
【解説】
グリニッジ標準時(GMT)の2001年1月1日0時0分0秒と現在の日付時間との差を秒数(NSTimeInterval)で返します。
【例文】
#import "MyObject.h"
@implementation MyObject
- (IBAction)myAction:(id)sender
{
NSDate *theDate1 = [NSDate dateWithString:@"2002-12-03 04:56:00 +0900"];
NSLog([NSString stringWithFormat:@"%.1f",[theDate1 timeIntervalSinceReferenceDate]]);
}
@end
![]() | |
この記事を評価してください。
| Home 目次>Foundation>NSDate | 修正日2006.12.26 |