I am using
NSDate *date = [NSDate date];
for getting the date, but the date I get is off by 2 hours.
You can get your date corrected like this:
NSDate * dateGMT = [NSDate date]; NSTimeInterval secondsFromGMT = [[NSTimeZone localTimeZone] secondsFromGMT]; NSDate * correctDate = [dateGMT dateByAddingTimeInterval:secondsFromGMT];