Q:

iOS NSDateFormatter ignoring timezone

I'm currently pulling date/times from a Postgresql database via json and converting the date to an NSDate. I originally saved my date at Jan 15, 12PM PST. Can someone see where in the following process I go wrong ? It seems that on the iOS side its ignoring the timestamp 
Originally the date in PostgreSql looks like: 
2015-01-16 20:00:10+00

The date in JSON looks like:
"start_time" = "2015-01-16T20:00:10.000Z";

And when I convert this date using:
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.SSS'Z"];

I get
  2015-01-17 04:00:10 +0000

Which also read:
  "start_time" = "2015-01-16 20:00:10 PST in the debugger

A:

The problem is you are quoting the timezone format specifier. You want:
[formatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.SSSZ"];

Note the lack of quote before the Z.

