title: How to calculate no of days in current date in iphone
body: <p>I'm working on an iPhone application.</p>
  
  <p>How can I get number of days from current year first date to current date in iPhone. </p>
  
  <p>I tried with this code:
    NSCalendar *gregorianCalendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];</p>
  
  <pre><code>NSDateComponents *components = [gregorianCalendar components:NSDayCalendarUnit fromDate:self toDate:aDate options:0];
  
  return [components day];
  </code></pre>
  
  <p>But when i give from date is: jan /01/2013  todate is: dec/12/31 i got 363 day. But we have 365 days. </p>
  
  <p>Please help me to out of this issue. Thanks.</p>