Tuesday, 15 May 2012

xcode - Getting NSDate for some point in the future -



xcode - Getting NSDate for some point in the future -

i need store date in future, using nsdate.

if utilize timeinterval (from now) in seconds, going run problems when crossing summer/winter time.

is there way store, "this coming mon @ 5.30", in form avoid problem, doesn't matter whether mon after putting clocks back/forward?

(the purpose of delete appointment date - stored online - 1 time has passed.)

not able test moment, can following, create date specified calendar components:

nscalendar *calendar = [[nscalendar alloc] initwithcalendaridentifier:nsgregoriancalendar]; nsdatecomponents *components = [[nsdatecomponents alloc] init]; [components setcalendar:calendar]; [components setyear:2014]; [components setmonth:6]; [components setday:18]; [components sethour:5]; [components setminute:30]; nsdate *yourdate = [calendar datefromcomponents:components];

xcode nsdate nstimeinterval

No comments:

Post a Comment