-1

i want to convert GMT time into local time . please suggest how to convert this time into current local time in ios application.

please suggest . thanks in advance.

jaydev
  • 1,629
  • 5
  • 17
  • 31

1 Answers1

2

This is it ;

 NSDate *date = [NSDate date];
 NSDateFormatter *df = [NSDateFormatter new];
 [df setDateFormat:@"dd/MM/yyyy HH:mm"];

 //Create a date string in the local timezone
 df.timeZone = [NSTimeZone timeZoneForSecondsFromGMT:[NSTimeZone localTimeZone].secondsFromGMT];
 NSString *localDateString = [df stringFromDate:date];
Kumar KL
  • 15,315
  • 9
  • 38
  • 60