I actually see no connection between the midnightUTC method and your provided code.
Anyway, the problem with your given example is that, the parsing of the string 4/18/11
will default the missing values like minutes etc AND your current time zone, but the string will be assumed as GMT time so this will result in the offset you see.
The solution is to set the time zone for the NSDateFormatter. Look at this code, I've tested it a minute ago, and the console output. aaa reveals the odd offset, bbb does look as expected.
NSDateFormatter *dt = [[[NSDateFormatter alloc] init] autorelease];
[dt setDateStyle:NSDateFormatterShortStyle];
NSDate *aaa = [dt dateFromString:@"4/18/11"];
NSLog(@"1a. %@", [dt timeZone]);
NSLog(@"1b. %@", aaa);
[dt setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"GMT"]];
NSDate *bbb = [dt dateFromString:@"4/18/11"];
NSLog(@"2a. %@", [dt timeZone]);
NSLog(@"2b. %@", bbb);
Console output
1a. Europe/Berlin (CEST) offset 7200 (Daylight)
1b. 2011-04-17 22:00:00 +0000
2a. GMT (GMT+00:00) offset 0
2b. 2011-04-18 00:00:00 +0000