-1

I have some trouble to convert this string :

@"15/08/2014 08:30"

Into an NSDate, here my code :

NSDateFormatter *formatter = [[NSDateFormatter alloc] init];

[formatter setLocale:[NSLocale currentLocale]];

[formatter setTimeZone:[NSTimeZone localTimeZone]];

[formatter setDateFormat:@"dd/MM/yyyy HH:mm"];

When I print out [formatter dateFromString:fullDatesString]; (fullDatesString is my string) the result is :

2014-08-15 06:30:00 +0000

Why my time is less than 2 hours between my string and my NSDate object ?

alex3165
  • 195
  • 1
  • 11

1 Answers1

3

When you print the description of the NSDate, it prints in in GMT (+0000) regardless of what timezone you or the NSDate is in.

If you convert that time to your timezone (GMT + 2 I assume), then the time is correct.

Lord Zsolt
  • 6,492
  • 9
  • 46
  • 76