title: iphone sqlite NSDate bug
body: <p>i use core data in my iphone app, but in some case i use sqlite to access to data and ia have a problem with NSDate.</p>
  
  <pre><code>NSDate *now = [NSDate date];
          NSCalendar *calender = [NSCalendar currentCalendar];;
          NSDateComponents *comp = [calender components:NSYearCalendarUnit fromDate:now];
          [comp setDay:1];
          [comp setMonth:1];
          NSDate *yearAgo = [calender dateFromComponents:comp];
          NSPredicate *predicate = [NSPredicate predicateWithFormat:@"date &gt; %@",yearAgo];
  </code></pre>
  
  <p>This code works and select records from the start of year, but if i use sqlite raw query</p>
  
  <pre><code>NSDate *current=[NSDate date];
              NSDateComponents *comps = [gregorian components:(NSDayCalendarUnit | NSMonthCalendarUnit |NSYearCalendarUnit) fromDate:current];
              [comps setDay:1];
              [comps setMonth:1];
  
              NSDate *yearDate = [gregorian dateFromComponents:comps];
  
              [where appendFormat:@"zdate &gt; '%@' ",yearDate];
  </code></pre>
  
  <p>I have a problem, wrong date determined by the records, Records that in core date has date like 2008-01-01 in sqlite have dates like 1977 year.
  How to fix it? May be I was wrong to use NSDate in the query?</p>