• 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
NSTimeInterval
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTimeInterval


  • Subject: NSTimeInterval
  • From: Maxwell Robertson <email@hidden>
  • Date: Mon, 29 Aug 2005 22:29:36 +0100

Hi,
Basic question I am afraid:

NSCalendarDate *now
NSTimeInterval nowSecs;
NSString *nowStr;

now = [NSCalendarDate calendarDate];
nowStr = [now descriptionWithCalendarFormat:@"%m/%d/%y];
//PRINT THE DATE
NSLog(nowStr);

nowSecs = [now timeIntervalSinceReferenceDate];

NSCalendarDate *now2 = [NSCalendarDate dateWithYear:0 month:0 day:0 hour:0 minute:0 second:nowSecs timeZone:nil];
nowStr = [now2 descriptionWithCalendarFormat:@"%m/%d/%y];
//PRINT THE DATE
NSLog(nowStr);


Why do these dates not match?
Should they not both be referencing the same start time and the number of seconds since then converted back to now should be today.


Apologies in advance - I am trying to learn obj-c and my last post was deemed too trivial by the adminstrator, so hopefully this is not also.
(trying to build a modal password dialog with bullet chars but tracking real chars - guess I am below trivial - :-) )


Basically I am trying to find the obj-c equivalent of datetosecs and secstodate that could be used under the classic programming model.

Thanks,
Max.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSTimeInterval
      • From: "Sean McBride" <email@hidden>
  • Prev by Date: Re: Problems while using NSBezierPath
  • Next by Date: Re: NSTimeInterval
  • Previous by thread: Re: Application start-up
  • Next by thread: Re: NSTimeInterval
  • Index(es):
    • Date
    • Thread