title: a date string without year to NSDate with year
body: <p>I have a date string of
       "5:09 pm Wed Sep 2",which is coming from server.
      when converting the string into <code>NSDate</code>.
      "2000-09-02 17:09:00 +0000" but the year should have been "2015" like:
      "2015-09-02 17:09:00 +0000"</p>
  
  <p>Here is my code please let me know where is the problem</p>
  
  <pre><code>NSString *dateStr = @"5:09 pm Wed Sep 2";
  
  // Convert string to date object
  NSString *dateFormat=  ([self hasAMPM])?@"hh:mm a EEEE MMM d":@"hh:mm a EEEE MMM d" ;
      NSDate * date = [self toLocalTime:[self convertDateFromString:dateStr OutputFormat:dateFormat]];
  
  
  ///****
  -(BOOL)hasAMPM{
      NSString *formatStringForHours = [NSDateFormatter dateFormatFromTemplate:@"j" options:0 locale:[NSLocale currentLocale]];
  
      NSRange containsA = [formatStringForHours rangeOfString:@"a"];
      BOOL hasAMPM = containsA.location != NSNotFound;
      return hasAMPM;
  }
  
  -(NSDate *)toLocalTime:(NSDate *)date
  {
      NSTimeZone *tz = [NSTimeZone systemTimeZone];
      NSInteger seconds = [tz secondsFromGMTForDate: date];
      return [NSDate dateWithTimeInterval: seconds sinceDate: date];
  }
  
  -(NSDate *)convertDateFromString:(NSString *)strDate OutputFormat:(NSString *)outPutFormat
  {
      NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
      [formatter setDateFormat:outPutFormat];
  
      NSDate *date1= [formatter dateFromString:strDate];
      return date1;
  }
  </code></pre>
  
  <p>Please help me to get out of this situation.</p>