Q:

NSDate from NSString problems

Getting a NSString as follows:
NSString *lastSyncDate = [[items objectAtIndex:0] objectForKey:@"LastSyncDate"];

This value is: 1/1/2010 12:00:00 AM
I am using the following to convert to a date:
NSDateFormatter *df = [[NSDateFormatter alloc] init];
[df setTimeStyle:NSDateFormatterFullStyle];
[df setDateFormat:@"MMMM d, y HH:mm:ss ZZZ"];
NSDate *mySyncDate = [df dateFromString:lastSyncDate];

This gives me a null value? 

A:

Your date format doesn't match the format of the string.   
Try 
[df setDateFormat:@"M/d/y hh:mm:ss a"];

or 
[df setDateFormat:@"M/d/y h:mm:ss a"]; // if the hours aren't zero-padded

The format strings are a Unicode standard described at http://unicode.org/reports/tr35/tr35-6.html#Date_Format_Patterns

