macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

dateWithTimeIntervalSinceReferenceDate:

2001年1月1日0時0分0秒から指定した秒数分進んだ(遅れた)時間を返します
+(id)dateWithTimeIntervalSinceReferenceDate:(NSTimeInterval)seconds:

解説

グリニッジ標準時(GMT)の2001年1月1日0時0分0秒から指定した秒数分進んだ(遅れた)時間を返します。
未来の日付けはプラス、過去の日付けはマイナスをセットします。
【NSTimeInterval】
● 秒数をdouble数値で指定します。

返り値

( id )

時間

引数

( NSTimeInterval )seconds

時間間隔(秒)

クラス

NSDate

Class Methods

使用可能

10.0

参照

- initWithTimeIntervalSinceReferenceDate:

例文

#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
{
NSDate *theDate;
theDate = [NSDate dateWithTimeIntervalSinceReferenceDate:3600]; 
[myOutlet setStringValue:[theDate description]];
}

@end