1. Adeel Khan
  2. ISO 8601 parser/unparser


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
  • Branches default

Comments (0)

Files changed (1)

File ISO8601DateFormatter.m

View file
 //printf formats.
-#define ISO_TIMEZONE_OFFSET_FORMAT @"%+02d%02d"
+#define ISO_TIMEZONE_OFFSET_FORMAT @"+%02d%02d"
 @interface ISO8601DateFormatter(UnparsingPrivate)