A few things:
- Don't set the timezone on the date formatter. And then remove the quotes around the
Z
in the format string. This will allow the date formatter to determine the timezone from the actual date string. - The output of
0822
is correct for your system timezone because you were on day light savings time on October 19th. On that date you were GMT-4, not GMT-5. In Canada, in 2011, DST ended on November 6th.