• 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
Displaying current time using NSCalenderDAte
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Displaying current time using NSCalenderDAte


  • Subject: Displaying current time using NSCalenderDAte
  • From: "haresh vavdiya" <email@hidden>
  • Date: Sat, 31 May 2008 16:52:59 +0530

Hi Friends,

          I have successfully get current time but now i want to to digital
clock but for that i need to have current minute and hours, so how can i get
this?

         I found some method of NSCalenderDate which give us hours and
minutes i can't get current time and date it display 2001 jan 1

          my code is

                  NSCalendarDate *currentTime = [[NSCalendarDate alloc]
initWithTimeIntervalSinceReferenceDate:000000];
                  int minuteInc = (minute>=0 ? minute-[currentTime
minuteOfHour] : 0);
                  int hourInc = (hour>=0 ? hour-[currentTime hourOfDay] :
0);
                  [self incrementHour: hourInc andMinute:minuteInc];
                  [self time];



for current time and date we have to gice one arguments intead of 000000 so
that we can get curretn time but i have tried many digit but i can't proper
output,
if anyone knoe please guide me
_______________________________________________

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

  • Follow-Ups:
    • Re: Displaying current time using NSCalenderDAte
      • From: mmalc crawford <email@hidden>
    • Re: Displaying current time using NSCalenderDAte
      • From: Andreas Mayer <email@hidden>
  • Prev by Date: Re: KVO: I get called on change, but then can't get the object
  • Next by Date: runloops and NSURLConnection
  • Previous by thread: Re: Finding the largest value in an NSTreeController?
  • Next by thread: Re: Displaying current time using NSCalenderDAte
  • Index(es):
    • Date
    • Thread