Q:

date formatting returns 12 hour format even when locale idenifier en_GB set

+(NSDate *)DateServerFormatFromString:(NSString *)date
{
NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init] ;
NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_GB"];
[dateFormatter setLocale:locale];
[dateFormatter setDateFormat:@"dd/MM/yyyy HH:mm:ss"];
NSDate* returnDate = [dateFormatter dateFromString:date];
return returnDate;

}
The function returns date in format "2013-05-09 08:06:04 AM +0000". But i want it in 24 hour format. The date being passed to this function is in the exact same format as given in setDateFormat method.
The device's region format is set to "United Kingdom" and time format is set to "12 hour format". This should not be changed. When time format is set to 24 hour format in the device, the function works perfectly. What is wrong with the code. I am using iPad 1 with OS 5.1.1.   Setting locale identifer or even timezone didnt make a difference. Thanks in advance.

A:

This is not necessarily an answer, just an explanation, found in the Apple docs (here):

Although in principle a format string specifies a fixed format, by
  default NSDateFormatter still takes the user’s preferences (including
  the locale setting) into account. You must consider the following
  points when using format strings:

NSDateFormatter treats the numbers in a string you parse as if they
  were in the user’s chosen calendar. For example, if the user selects
  the Buddhist calendar, parsing the year 2010 yields an NSDate object
  in 1467 in the Gregorian calendar. (For more about different
  calendrical systems and how to use them, see Date and Time Programming
  Guide.)
In iOS, the user can override the default AM/PM versus 24-hour
  time setting. This may cause NSDateFormatter to rewrite the format
  string you set.

