title: Getting next date and previous day date
body: <p>I basically want to convert a particular date (x) to the previous day date(x - 1 day) and also to the next day date (x + 1 day). I am using the following code for this :</p>
  
  <pre><code>NSDate *datePlusOneDay = [currentDate dateByAddingTimeInterval:(60 * 60 * 24)];
  </code></pre>
  
  <p>However I have my date (x) in NSString format, and I need to convert the NSString(<code>myDateString</code>) to NSDate(<code>myDate</code>) before applying the above code.
  I have a NSString containing date in format MM-dd-yyyy.
  For converting I am using the following code , but I am getting absurd values.</p>
  
  <pre><code> NSLog(@"myDateString=%@",myDateString);//output:myDateString=10-25-2012//all correct
  NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
  [formatter setDateFormat:@"MM-dd-yyyy"];
  NSDate *myDate=[formatter dateFromString:myDateString];
  NSLog(@"myDate=%@",myDate);//output:myDate=2012-10-24 18:30:00 +0000 // I only want the date to be shown // and why has the format changed
  NSDate *datePlusOneDay = [currentDate dateByAddingTimeInterval:(60 * 60 * 24)];
  NSLog(@"datePlusOneDay=%@",datePlusOneDay);//output:datePlusOneDay=2012-10-25 18:30:00 +0000// I only want the date to come , not time // and why has the format changed
  </code></pre>
  
  <p>Later again I need to convert the NSDate to NSString</p>
  
  <pre><code>NSString *curentString=[formatter stringFromDate:datePlusOneDay];
  NSLog(@"curentString=%@",curentString); //output:curentString=10-26-2012
  </code></pre>
  
  <p>Similarly I also want to get the previous date.
  Please help guys !! and ho ho MERRY CHRISTMAS !!</p>