macOS/iOS API解説

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

目次

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

タイムゾーン

クラス

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