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
Delivered-to: email@hidden
Delivered-to: email@hidden
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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden
This email sent to email@hidden
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.