Re: Displaying current time using NSCalenderDAte
Re: Displaying current time using NSCalenderDAte
- Subject: Re: Displaying current time using NSCalenderDAte
- From: Andreas Mayer <email@hidden>
- Date: Sat, 31 May 2008 15:53:51 +0200
Am 31.05.2008 um 13:22 Uhr schrieb haresh vavdiya:
NSCalendarDate *currentTime = [[NSCalendarDate alloc]
initWithTimeIntervalSinceReferenceDate:000000];
Since you specified a time interval of zero (one '0' is enough; it's
just an integer), this will give you 1 January 2001, as stated by the
documentation for -initWithTimeIntervalSinceReferenceDate:.
To get the current date you use
NSCalendarDate *currentDate = [NSCalendarDate calendarDate];
int minuteInc = (minute>=0 ? minute-[currentTime
minuteOfHour] : 0);
int hourInc = (hour>=0 ? hour-[currentTime
hourOfDay] :
0);
[self incrementHour: hourInc andMinute:minuteInc];
[self time];
I have no idea what you are trying to do here ...
Andreas
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden