dateWithYear:month:day:hour:minute:second:timeZone:
年、月、日、時、分、秒、タイムゾーンでカレンダー日付を作って初期化して返します
+(id)dateWithYear:(int)year: month:(unsigned)month: day:(unsigned)day: hour:(unsigned)hour: minute:(unsigned)minute: second:(unsigned)second: timeZone:(NSTimeZone *)aTimeZone:
解説
年、月、日、時、分、秒、タイムゾーンでカレンダー日付を作って初期化して返します。
返り値
( id )
カレンダー日付/nil
引数
( int )year
年(4桁)
( unsigned )month
月
( unsigned )day
日
( unsigned )hour
時
( unsigned )minute
分
( unsigned )second
秒
( NSTimeZone * )aTimeZone
フレームワーク
Foundation
クラス
NSCalendarDate
Class Methods
使用可能
10.0
参照
- initWithYear:month:day:hour:minute:second:timeZone:
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSDate *theDate; theDate = [NSCalendarDate dateWithYear:2001 month:1 day:1 hour:0 minute:0 second:0 timeZone:[NSTimeZone timeZoneWithAbbreviation:@"JST"]]; NSLog([theDate description]); } @end