• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Displaying current time using NSCalenderDAte
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Displaying current time using NSCalenderDAte (From: "haresh vavdiya" <email@hidden>)

  • Prev by Date: runloops and NSURLConnection
  • Next by Date: Re: runloops and NSURLConnection
  • Previous by thread: Displaying current time using NSCalenderDAte
  • Next by thread: Re: Displaying current time using NSCalenderDAte
  • Index(es):
    • Date
    • Thread