Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Process minutes & seconds, and default to local time zone if not specified #1

wants to merge 1 commit into from

2 participants


In processing the time, I noticed that the minutes and seconds were not being processed if the format did not include component separators. E.g. T143000Z. Also if the timezone is not specified, the local time zone should be used. E.g. T143000, should set the timezone to local.


Thanks for the pull request @henry-chan-git. Unfortunately, I'm not the maintainer of this libary -- this is just a git mirror of @boredzo's mercurial repo at

I recommend sending your patches to him, and I'll update this mirror when they are committed. Thanks!

@nixme nixme closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 10 additions and 0 deletions.
  1. +10 −0 ISO8601DateFormatter.m
10 ISO8601DateFormatter.m
@@ -516,6 +516,12 @@ - (NSDateComponents *) dateComponentsFromString:(NSString *)string timeZone:(out
+ else // Process minutes and second w/o timeSep
+ {
+ minute = read_segment_2digits(ch, &ch);
+ if (isdigit(*ch))
+ second = read_segment_2digits(ch, &ch);
+ }
if (!strict) {
if (isspace(*ch)) ++ch;
@@ -566,6 +572,10 @@ - (NSDateComponents *) dateComponentsFromString:(NSString *)string timeZone:(out
+ if (timeZone == nil) // No time zone specified, use local time.
+ {
+ timeZone = [NSTimeZone localTimeZone];
+ }
if (isValidDate) {
components.year = year; = day;
Something went wrong with that request. Please try again.