When I store a date in CoreData as [NSDate date], it is saved -5:30 difference. In core data I used attribute type as date.
How to store NSdate with timeZone?
Update: Here is the code I am using:
To store the date:
database = (DataBase*) [fetchResults objectAtIndex:indexVal];
[database setDate:[NSDate date]];
NSError error = nil;
[managedObjectContext save:&error]
To retrieve the date:
DataBase *newDataBase = (DataBase) [fetchResults objectAtIndex:i];
NSDate *RetrivedDate = [newDataBase Date];
NSLog(@"Retrived Date :",RetrivedDate");
Before storing I log it. It shows current date and time. After storing I immediately fetched the date . but it showed 1 day delayed date..