Commits

Adeel Khan  committed 78f6c6c

Fix a bug with the timezone offset format when unparsing dates.

ISO 8601 syntax requires the timezone offset format to be "+HH" or "+HHMM" or "+HH:MM" [1]. Currently the unparser uses something like the second format, but the HH portion turns into H instead of 0H if the hour is less than 10 (e.g. +200 instead of +0200). This commit fixes this.

[1] http://en.wikipedia.org/wiki/ISO_8601#Time_zone_designators

  • Participants
  • Parent commits 788c145

Comments (0)

Files changed (1)

File ISO8601DateFormatter.m

 #define ISO_TIME_WITH_TIMEZONE_FORMAT  ISO_TIME_FORMAT @"Z"
 //printf formats.
 #define ISO_TIMEZONE_UTC_FORMAT @"Z"
-#define ISO_TIMEZONE_OFFSET_FORMAT @"%+02d%02d"
+#define ISO_TIMEZONE_OFFSET_FORMAT @"+%02d%02d"
 
 @interface ISO8601DateFormatter(UnparsingPrivate)