So I have 2 entities which both carry an NSDate attribute. My "OwedMoney" entity has a "youOweDate" NSDate attribute and my "TheyOweMoney" entity has a "dueDate" NSDate attribute. On both View Controllers, I have a UIDatePicker type Date. So it only displays the month, day, and the year. Below in the following code is where I try to save the DatePicker's date value. My DatePicker's name is "personWhoOwesYouDueDate"
NSDate *choice = [personWhoOwesYouDueDate date];
NSManagedObjectContext *context = [self managedObjectContext];
TheyOweMoney *owedMoney = [NSEntityDescription insertNewObjectForEntityForName:@"TheyOweMoney" inManagedObjectContext:context];
[owedMoney setValue:choice forKey:@"dueDate"];
Then I have an NSLog to check the value
NSLog(@"%@", choice);
So when my application loads and I pick a date like February 8 2014 for example, I don't get the expected result
Entered: February 8 2014
Result: 2014-02-09 01:50:29 +0000
So it has the Year and month correct but the day is wrong. Also, is there a way to get rid of the "+0000" part? It's really annoying. Another thing is that my date value CANNOT be a string because when I set it's value to the attribute it MUST be an instance of NSDate.
All help is appreciated, thanks.