Iphone NSCalendar:一个月内获得数周的问题

Iphone NSCalendar:一个月内获得数周的问题,iphone,objective-c,cocoa,nscalendar,Iphone,Objective C,Cocoa,Nscalendar,我正在创建一个日历控件 我需要知道的一件事是一个月有多少周 所以NSCalendarrangeOfUnit:inUnit:forDate似乎正是我需要的 除了我注意到一些似乎不对劲的事情,我不太明白为什么会发生这种事 下面的代码 NSCalendar *calendar = [NSCalendar currentCalendar]; NSDateComponents *dateComponents = [[NSDateComponents alloc] init]; [dateComponen

我正在创建一个日历控件

我需要知道的一件事是一个月有多少周

所以
NSCalendar
rangeOfUnit:inUnit:forDate
似乎正是我需要的

除了我注意到一些似乎不对劲的事情,我不太明白为什么会发生这种事

下面的代码

NSCalendar *calendar = [NSCalendar currentCalendar];

NSDateComponents *dateComponents = [[NSDateComponents alloc] init];
[dateComponents setYear: 2010];
[dateComponents setDay: 1];

for (int x=1; x<=12; x++)
{
    [dateComponents setMonth: x];

    NSDate *date = [calendar dateFromComponents:dateComponents];
    NSLog(@"Date: %@", date);

    NSRange range = [calendar rangeOfUnit: NSWeekCalendarUnit
                                   inUnit: NSMonthCalendarUnit
                                  forDate:date];

    NSLog(@"%d Weeks in Month %d", range.length, [dateComponents month]);

}
我不太明白为什么我在第12个月有52周的假期

有什么线索吗

2010年3月20日编辑:

因为我无法使用
rangeOfUnit:inUnit:forDate
计算一个月的周数。我决定想出一种不同的方法来计算相同的值

我想我应该用一种非公历本地化的方式来做这件事,所以我试图从一周的天数开始,但我得到了一周28天的结果。所以我开始写更多的代码来找出原因

我想确保我玩的那种NSCalendar实际上是我应该得到的。。。这让我发现了一些不同

NSCalendar *currentCalendar = [NSCalendar currentCalendar];

NSLog(@"Calendar with 'currentCalendar' Identifier: %@", 
      [currentCalendar calendarIdentifier]);

NSCalendar *calendarWithIdentifier = [[[NSCalendar alloc] initWithCalendarIdentifier: NSGregorianCalendar] autorelease];

NSLog(@"Calendar created with identifier Identifier: %@", 
      [calendarWithIdentifier calendarIdentifier]);

NSDate *now = [[NSDate alloc] init];

NSDateComponents *currentMonth = [currentCalendar components: NSMonthCalendarUnit | NSYearCalendarUnit
                                                    fromDate: now];

NSDate *currentMonthDate = [currentCalendar dateFromComponents: currentMonth];

NSRange daysInWeekRange = [currentCalendar rangeOfUnit: NSDayCalendarUnit
                                                inUnit: NSWeekCalendarUnit
                                               forDate: currentMonthDate];

NSLog(@"CurrentCalendar: Length:%u Location:%u", daysInWeekRange.length, daysInWeekRange.location);

currentMonth = [calendarWithIdentifier components: NSMonthCalendarUnit | NSYearCalendarUnit 
                                         fromDate: now];

currentMonthDate = [calendarWithIdentifier dateFromComponents: currentMonth];

daysInWeekRange = [calendarWithIdentifier rangeOfUnit: NSDayCalendarUnit
                                               inUnit: NSWeekCalendarUnit
                                              forDate: currentMonthDate];

NSLog(@"GregorianCalendar: Length:%u Location:%u", daysInWeekRange.length, daysInWeekRange.location);
这让我得到了以下日志结果

2010-03-20 21:02:27.245 Scrap[52189:207] Calendar with 'currentCalendar' Identifier: gregorian
2010-03-20 21:02:27.246 Scrap[52189:207] Calendar created with identifier Identifier: gregorian
2010-03-20 21:02:27.248 Scrap[52189:207] CurrentCalendar: Length:28 Location:1
2010-03-20 21:02:27.249 Scrap[52189:207] GregorianCalendar: Length:7 Location:1
根据@CarlNorum的经验,我将代码片段编译为10.6 Cocoa应用程序,得到以下结果

2010-03-20 21:05:35.636 ScrapCocoa[52238:a0f] Calendar with 'currentCalendar' Identifier: gregorian
2010-03-20 21:05:35.636 ScrapCocoa[52238:a0f] Calendar created with identifier Identifier: gregorian
2010-03-20 21:05:35.637 ScrapCocoa[52238:a0f] CurrentCalendar: Length:6 Location:1
2010-03-20 21:05:35.638 ScrapCocoa[52238:a0f] GregorianCalendar: Length:7 Location:1
我看到了希望,将NSCalendar实例显式地创建为公历将在我原来的问题中产生更好的结果。。。所以我修改了原始代码

NSCalendar *currentCalendar = [NSCalendar currentCalendar];

NSLog(@"Calendar with 'currentCalendar' Identifier: %@", 
      [currentCalendar calendarIdentifier]);

NSCalendar *calendarWithIdentifier = [[[NSCalendar alloc] initWithCalendarIdentifier: NSGregorianCalendar] autorelease];

NSLog(@"Calendar created with identifier Identifier: %@", 
      [calendarWithIdentifier calendarIdentifier]);

NSDateComponents *dateComponents = [[[NSDateComponents alloc] init] autorelease];
[dateComponents setYear: 2010];
[dateComponents setDay: 1];

for (int x=1; x<=12; x++)
{
    [dateComponents setMonth: x];

    NSDate *date = [currentCalendar dateFromComponents: dateComponents];
    NSRange range = [currentCalendar rangeOfUnit: NSWeekCalendarUnit
                                          inUnit: NSMonthCalendarUnit
                                         forDate: date];

    NSLog(@"CurrentCalendar Date: %@", date);
    NSLog(@"CurrentCalendar: %d Weeks in Month %d", range.length, [dateComponents month]);

    date = [calendarWithIdentifier dateFromComponents: dateComponents];

    range = [calendarWithIdentifier rangeOfUnit: NSWeekCalendarUnit
                                         inUnit: NSMonthCalendarUnit
                                        forDate: date];

    NSLog(@"GregorianCalendar Date: %@", date);
    NSLog(@"GregorianCalendar: %d Weeks in Month %d", range.length, [dateComponents month]);

}
为Cocoa编译代码只是为了好玩,实际上很有趣。。。 因为结果真的很不一样

2010-03-20 21:11:24.610 ScrapCocoa[52313:a0f] Calendar with 'currentCalendar' Identifier: gregorian
2010-03-20 21:11:24.611 ScrapCocoa[52313:a0f] Calendar created with identifier Identifier: gregorian
2010-03-20 21:11:24.613 ScrapCocoa[52313:a0f] CurrentCalendar Date: 2010-01-01 00:00:00 -0500
2010-03-20 21:11:24.613 ScrapCocoa[52313:a0f] CurrentCalendar: 6 Weeks in Month 1
2010-03-20 21:11:24.614 ScrapCocoa[52313:a0f] GregorianCalendar Date: 2010-01-01 00:00:00 -0500
2010-03-20 21:11:24.615 ScrapCocoa[52313:a0f] GregorianCalendar: 5 Weeks in Month 1
2010-03-20 21:11:24.616 ScrapCocoa[52313:a0f] CurrentCalendar Date: 2010-02-01 00:00:00 -0500
2010-03-20 21:11:24.616 ScrapCocoa[52313:a0f] CurrentCalendar: 5 Weeks in Month 2
2010-03-20 21:11:24.617 ScrapCocoa[52313:a0f] GregorianCalendar Date: 2010-02-01 00:00:00 -0500
2010-03-20 21:11:24.618 ScrapCocoa[52313:a0f] GregorianCalendar: 4 Weeks in Month 2
2010-03-20 21:11:24.619 ScrapCocoa[52313:a0f] CurrentCalendar Date: 2010-03-01 00:00:00 -0500
2010-03-20 21:11:24.619 ScrapCocoa[52313:a0f] CurrentCalendar: 5 Weeks in Month 3
2010-03-20 21:11:24.620 ScrapCocoa[52313:a0f] GregorianCalendar Date: 2010-03-01 00:00:00 -0500
2010-03-20 21:11:24.621 ScrapCocoa[52313:a0f] GregorianCalendar: 5 Weeks in Month 3
2010-03-20 21:11:24.622 ScrapCocoa[52313:a0f] CurrentCalendar Date: 2010-04-01 00:00:00 -0400
2010-03-20 21:11:24.622 ScrapCocoa[52313:a0f] CurrentCalendar: 5 Weeks in Month 4
2010-03-20 21:11:24.623 ScrapCocoa[52313:a0f] GregorianCalendar Date: 2010-04-01 00:00:00 -0400
2010-03-20 21:11:24.623 ScrapCocoa[52313:a0f] GregorianCalendar: 5 Weeks in Month 4
2010-03-20 21:11:24.624 ScrapCocoa[52313:a0f] CurrentCalendar Date: 2010-05-01 00:00:00 -0400
2010-03-20 21:11:24.625 ScrapCocoa[52313:a0f] CurrentCalendar: 6 Weeks in Month 5
2010-03-20 21:11:24.625 ScrapCocoa[52313:a0f] GregorianCalendar Date: 2010-05-01 00:00:00 -0400
2010-03-20 21:11:24.626 ScrapCocoa[52313:a0f] GregorianCalendar: 6 Weeks in Month 5
2010-03-20 21:11:24.627 ScrapCocoa[52313:a0f] CurrentCalendar Date: 2010-06-01 00:00:00 -0400
2010-03-20 21:11:24.627 ScrapCocoa[52313:a0f] CurrentCalendar: 5 Weeks in Month 6
2010-03-20 21:11:24.628 ScrapCocoa[52313:a0f] GregorianCalendar Date: 2010-06-01 00:00:00 -0400
2010-03-20 21:11:24.628 ScrapCocoa[52313:a0f] GregorianCalendar: 5 Weeks in Month 6
2010-03-20 21:11:24.629 ScrapCocoa[52313:a0f] CurrentCalendar Date: 2010-07-01 00:00:00 -0400
2010-03-20 21:11:24.630 ScrapCocoa[52313:a0f] CurrentCalendar: 5 Weeks in Month 7
2010-03-20 21:11:24.630 ScrapCocoa[52313:a0f] GregorianCalendar Date: 2010-07-01 00:00:00 -0400
2010-03-20 21:11:24.631 ScrapCocoa[52313:a0f] GregorianCalendar: 5 Weeks in Month 7
2010-03-20 21:11:24.632 ScrapCocoa[52313:a0f] CurrentCalendar Date: 2010-08-01 00:00:00 -0400
2010-03-20 21:11:24.632 ScrapCocoa[52313:a0f] CurrentCalendar: 5 Weeks in Month 8
2010-03-20 21:11:24.633 ScrapCocoa[52313:a0f] GregorianCalendar Date: 2010-08-01 00:00:00 -0400
2010-03-20 21:11:24.633 ScrapCocoa[52313:a0f] GregorianCalendar: 6 Weeks in Month 8
2010-03-20 21:11:24.634 ScrapCocoa[52313:a0f] CurrentCalendar Date: 2010-09-01 00:00:00 -0400
2010-03-20 21:11:24.635 ScrapCocoa[52313:a0f] CurrentCalendar: 5 Weeks in Month 9
2010-03-20 21:11:24.636 ScrapCocoa[52313:a0f] GregorianCalendar Date: 2010-09-01 00:00:00 -0400
2010-03-20 21:11:24.636 ScrapCocoa[52313:a0f] GregorianCalendar: 5 Weeks in Month 9
2010-03-20 21:11:24.637 ScrapCocoa[52313:a0f] CurrentCalendar Date: 2010-10-01 00:00:00 -0400
2010-03-20 21:11:24.637 ScrapCocoa[52313:a0f] CurrentCalendar: 6 Weeks in Month 10
2010-03-20 21:11:24.638 ScrapCocoa[52313:a0f] GregorianCalendar Date: 2010-10-01 00:00:00 -0400
2010-03-20 21:11:24.639 ScrapCocoa[52313:a0f] GregorianCalendar: 5 Weeks in Month 10
2010-03-20 21:11:24.640 ScrapCocoa[52313:a0f] CurrentCalendar Date: 2010-11-01 00:00:00 -0400
2010-03-20 21:11:24.640 ScrapCocoa[52313:a0f] CurrentCalendar: 5 Weeks in Month 11
2010-03-20 21:11:24.641 ScrapCocoa[52313:a0f] GregorianCalendar Date: 2010-11-01 00:00:00 -0400
2010-03-20 21:11:24.641 ScrapCocoa[52313:a0f] GregorianCalendar: 5 Weeks in Month 11
2010-03-20 21:11:24.642 ScrapCocoa[52313:a0f] CurrentCalendar Date: 2010-12-01 00:00:00 -0500
2010-03-20 21:11:24.642 ScrapCocoa[52313:a0f] CurrentCalendar: 5 Weeks in Month 12
2010-03-20 21:11:24.643 ScrapCocoa[52313:a0f] GregorianCalendar Date: 2010-12-01 00:00:00 -0500
2010-03-20 21:11:24.644 ScrapCocoa[52313:a0f] GregorianCalendar: 5 Weeks in Month 12

我想这就是我放弃的时候了…

在10.6 SDK中尝试了这段代码,它似乎可以工作

2010-03-14 19:11:49.424 Untitled[61397:a0f] Date: 2010-01-01 00:00:00 -0500 2010-03-14 19:11:49.425 Untitled[61397:a0f] 6 Weeks in Month 1 2010-03-14 19:11:49.426 Untitled[61397:a0f] Date: 2010-02-01 00:00:00 -0500 2010-03-14 19:11:49.427 Untitled[61397:a0f] 5 Weeks in Month 2 2010-03-14 19:11:49.428 Untitled[61397:a0f] Date: 2010-03-01 00:00:00 -0500 2010-03-14 19:11:49.429 Untitled[61397:a0f] 5 Weeks in Month 3 2010-03-14 19:11:49.429 Untitled[61397:a0f] Date: 2010-04-01 00:00:00 -0400 2010-03-14 19:11:49.430 Untitled[61397:a0f] 5 Weeks in Month 4 2010-03-14 19:11:49.431 Untitled[61397:a0f] Date: 2010-05-01 00:00:00 -0400 2010-03-14 19:11:49.431 Untitled[61397:a0f] 6 Weeks in Month 5 2010-03-14 19:11:49.432 Untitled[61397:a0f] Date: 2010-06-01 00:00:00 -0400 2010-03-14 19:11:49.433 Untitled[61397:a0f] 5 Weeks in Month 6 2010-03-14 19:11:49.434 Untitled[61397:a0f] Date: 2010-07-01 00:00:00 -0400 2010-03-14 19:11:49.434 Untitled[61397:a0f] 5 Weeks in Month 7 2010-03-14 19:11:49.435 Untitled[61397:a0f] Date: 2010-08-01 00:00:00 -0400 2010-03-14 19:11:49.436 Untitled[61397:a0f] 5 Weeks in Month 8 2010-03-14 19:11:49.437 Untitled[61397:a0f] Date: 2010-09-01 00:00:00 -0400 2010-03-14 19:11:49.437 Untitled[61397:a0f] 5 Weeks in Month 9 2010-03-14 19:11:49.438 Untitled[61397:a0f] Date: 2010-10-01 00:00:00 -0400 2010-03-14 19:11:49.439 Untitled[61397:a0f] 6 Weeks in Month 10 2010-03-14 19:11:49.439 Untitled[61397:a0f] Date: 2010-11-01 00:00:00 -0400 2010-03-14 19:11:49.440 Untitled[61397:a0f] 5 Weeks in Month 11 2010-03-14 19:11:49.441 Untitled[61397:a0f] Date: 2010-12-01 00:00:00 -0500 2010-03-14 19:11:49.441 Untitled[61397:a0f] 5 Weeks in Month 12 2010-03-1419:11:49.424无标题日期:2010-01-01 00:00:00-0500 2010-03-14 19:11:49.425无标题[61397:a0f]第1个月6周 2010-03-1419:11:49.426无标题日期:2010-02-01 00:00:00-0500 2010-03-14 19:11:49.427无标题[61397:a0f]第二个月5周 2010-03-1419:11:49.428无标题[61397:a0f]日期:2010-03-01 00:00:00-0500 2010-03-14 19:11:49.429无标题[61397:a0f]第三个月5周 2010-03-1419:11:49.429无标题日期:2010-04-01 00:00:00-0400 2010-03-14 19:11:49.430无标题[61397:a0f]第4个月5周 2010-03-1419:11:49.431无标题日期:2010-05-01 00:00:00-0400 2010-03-14 19:11:49.431无标题[61397:a0f]第5个月6周 2010-03-1419:11:49.432无标题日期:2010-06-01 00:00:00-0400 2010-03-14 19:11:49.433第6个月无标题[61397:a0f]5周 2010-03-1419:11:49.434无标题日期:2010-07-01 00:00:00-0400 2010-03-14 19:11:49.434无标题[61397:a0f]第7个月5周 2010-03-1419:11:49.435无标题日期:2010-08-01 00:00:00-0400 2010-03-14 19:11:49.436无标题[61397:a0f]第8个月5周 2010-03-1419:11:49.437无标题日期:2010-09-01 00:00:00-0400 2010-03-14 19:11:49.437无标题[61397:a0f]第9个月5周 2010-03-1419:11:49.438无标题日期:2010-10-01 00:00:00-0400 2010-03-14 19:11:49.439无标题[61397:a0f]第10个月6周 2010-03-1419:11:49.439无标题日期:2010-11-01 00:00:00-0400 2010-03-14 19:11:49.440无标题[61397:a0f]第11个月5周 2010-03-1419:11:49.441无标题日期:2010-12-01 00:00:00-0500 2010-03-14 19:11:49.441第12个月无标题[61397:a0f]5周 我用iphonesdk进行了尝试,得到了与您相同的输出。目前还不清楚iphonesdk在其他许多月份是否也输出了正确的值。例如,我同意10.6SDK的答案,1月有6周

我看不出你的代码有任何明显的错误

我可能会首先建议去提交一个bug

你也可以去苹果的私人开发者论坛()试着问一下


当然,你也可以向苹果(AAPL.O:行情)提交技术支持事件dts@apple.com - ) ... 如果您的ADC帐户中没有任何帐户,我相信苹果会很乐意卖给您一个,您可以直接与苹果的工程师讨论这个问题。

我刚刚做了一个新项目,并运行了该代码,它的行为符合预期。这就是你看到的失败代码吗?你在12月得到52周?@AngrySpade,不,我在12月得到
5周
。这就是我得到52周的确切代码。顺便说一句,AngrySpade:(1)你泄露了date components对象,以及(2)你假设当前日历有12个月。用户的当前日历可能不是公历。我在论坛上问过。。。我们看看有没有什么结果。我已经收到更多的确认,这是一个错误。。。提交了一个苹果bug@愤怒的斯派德:这个URL在会话之外没有任何意义。bug编号会更有用。
2010-03-20 21:11:24.610 ScrapCocoa[52313:a0f] Calendar with 'currentCalendar' Identifier: gregorian
2010-03-20 21:11:24.611 ScrapCocoa[52313:a0f] Calendar created with identifier Identifier: gregorian
2010-03-20 21:11:24.613 ScrapCocoa[52313:a0f] CurrentCalendar Date: 2010-01-01 00:00:00 -0500
2010-03-20 21:11:24.613 ScrapCocoa[52313:a0f] CurrentCalendar: 6 Weeks in Month 1
2010-03-20 21:11:24.614 ScrapCocoa[52313:a0f] GregorianCalendar Date: 2010-01-01 00:00:00 -0500
2010-03-20 21:11:24.615 ScrapCocoa[52313:a0f] GregorianCalendar: 5 Weeks in Month 1
2010-03-20 21:11:24.616 ScrapCocoa[52313:a0f] CurrentCalendar Date: 2010-02-01 00:00:00 -0500
2010-03-20 21:11:24.616 ScrapCocoa[52313:a0f] CurrentCalendar: 5 Weeks in Month 2
2010-03-20 21:11:24.617 ScrapCocoa[52313:a0f] GregorianCalendar Date: 2010-02-01 00:00:00 -0500
2010-03-20 21:11:24.618 ScrapCocoa[52313:a0f] GregorianCalendar: 4 Weeks in Month 2
2010-03-20 21:11:24.619 ScrapCocoa[52313:a0f] CurrentCalendar Date: 2010-03-01 00:00:00 -0500
2010-03-20 21:11:24.619 ScrapCocoa[52313:a0f] CurrentCalendar: 5 Weeks in Month 3
2010-03-20 21:11:24.620 ScrapCocoa[52313:a0f] GregorianCalendar Date: 2010-03-01 00:00:00 -0500
2010-03-20 21:11:24.621 ScrapCocoa[52313:a0f] GregorianCalendar: 5 Weeks in Month 3
2010-03-20 21:11:24.622 ScrapCocoa[52313:a0f] CurrentCalendar Date: 2010-04-01 00:00:00 -0400
2010-03-20 21:11:24.622 ScrapCocoa[52313:a0f] CurrentCalendar: 5 Weeks in Month 4
2010-03-20 21:11:24.623 ScrapCocoa[52313:a0f] GregorianCalendar Date: 2010-04-01 00:00:00 -0400
2010-03-20 21:11:24.623 ScrapCocoa[52313:a0f] GregorianCalendar: 5 Weeks in Month 4
2010-03-20 21:11:24.624 ScrapCocoa[52313:a0f] CurrentCalendar Date: 2010-05-01 00:00:00 -0400
2010-03-20 21:11:24.625 ScrapCocoa[52313:a0f] CurrentCalendar: 6 Weeks in Month 5
2010-03-20 21:11:24.625 ScrapCocoa[52313:a0f] GregorianCalendar Date: 2010-05-01 00:00:00 -0400
2010-03-20 21:11:24.626 ScrapCocoa[52313:a0f] GregorianCalendar: 6 Weeks in Month 5
2010-03-20 21:11:24.627 ScrapCocoa[52313:a0f] CurrentCalendar Date: 2010-06-01 00:00:00 -0400
2010-03-20 21:11:24.627 ScrapCocoa[52313:a0f] CurrentCalendar: 5 Weeks in Month 6
2010-03-20 21:11:24.628 ScrapCocoa[52313:a0f] GregorianCalendar Date: 2010-06-01 00:00:00 -0400
2010-03-20 21:11:24.628 ScrapCocoa[52313:a0f] GregorianCalendar: 5 Weeks in Month 6
2010-03-20 21:11:24.629 ScrapCocoa[52313:a0f] CurrentCalendar Date: 2010-07-01 00:00:00 -0400
2010-03-20 21:11:24.630 ScrapCocoa[52313:a0f] CurrentCalendar: 5 Weeks in Month 7
2010-03-20 21:11:24.630 ScrapCocoa[52313:a0f] GregorianCalendar Date: 2010-07-01 00:00:00 -0400
2010-03-20 21:11:24.631 ScrapCocoa[52313:a0f] GregorianCalendar: 5 Weeks in Month 7
2010-03-20 21:11:24.632 ScrapCocoa[52313:a0f] CurrentCalendar Date: 2010-08-01 00:00:00 -0400
2010-03-20 21:11:24.632 ScrapCocoa[52313:a0f] CurrentCalendar: 5 Weeks in Month 8
2010-03-20 21:11:24.633 ScrapCocoa[52313:a0f] GregorianCalendar Date: 2010-08-01 00:00:00 -0400
2010-03-20 21:11:24.633 ScrapCocoa[52313:a0f] GregorianCalendar: 6 Weeks in Month 8
2010-03-20 21:11:24.634 ScrapCocoa[52313:a0f] CurrentCalendar Date: 2010-09-01 00:00:00 -0400
2010-03-20 21:11:24.635 ScrapCocoa[52313:a0f] CurrentCalendar: 5 Weeks in Month 9
2010-03-20 21:11:24.636 ScrapCocoa[52313:a0f] GregorianCalendar Date: 2010-09-01 00:00:00 -0400
2010-03-20 21:11:24.636 ScrapCocoa[52313:a0f] GregorianCalendar: 5 Weeks in Month 9
2010-03-20 21:11:24.637 ScrapCocoa[52313:a0f] CurrentCalendar Date: 2010-10-01 00:00:00 -0400
2010-03-20 21:11:24.637 ScrapCocoa[52313:a0f] CurrentCalendar: 6 Weeks in Month 10
2010-03-20 21:11:24.638 ScrapCocoa[52313:a0f] GregorianCalendar Date: 2010-10-01 00:00:00 -0400
2010-03-20 21:11:24.639 ScrapCocoa[52313:a0f] GregorianCalendar: 5 Weeks in Month 10
2010-03-20 21:11:24.640 ScrapCocoa[52313:a0f] CurrentCalendar Date: 2010-11-01 00:00:00 -0400
2010-03-20 21:11:24.640 ScrapCocoa[52313:a0f] CurrentCalendar: 5 Weeks in Month 11
2010-03-20 21:11:24.641 ScrapCocoa[52313:a0f] GregorianCalendar Date: 2010-11-01 00:00:00 -0400
2010-03-20 21:11:24.641 ScrapCocoa[52313:a0f] GregorianCalendar: 5 Weeks in Month 11
2010-03-20 21:11:24.642 ScrapCocoa[52313:a0f] CurrentCalendar Date: 2010-12-01 00:00:00 -0500
2010-03-20 21:11:24.642 ScrapCocoa[52313:a0f] CurrentCalendar: 5 Weeks in Month 12
2010-03-20 21:11:24.643 ScrapCocoa[52313:a0f] GregorianCalendar Date: 2010-12-01 00:00:00 -0500
2010-03-20 21:11:24.644 ScrapCocoa[52313:a0f] GregorianCalendar: 5 Weeks in Month 12
2010-03-14 19:11:49.424 Untitled[61397:a0f] Date: 2010-01-01 00:00:00 -0500 2010-03-14 19:11:49.425 Untitled[61397:a0f] 6 Weeks in Month 1 2010-03-14 19:11:49.426 Untitled[61397:a0f] Date: 2010-02-01 00:00:00 -0500 2010-03-14 19:11:49.427 Untitled[61397:a0f] 5 Weeks in Month 2 2010-03-14 19:11:49.428 Untitled[61397:a0f] Date: 2010-03-01 00:00:00 -0500 2010-03-14 19:11:49.429 Untitled[61397:a0f] 5 Weeks in Month 3 2010-03-14 19:11:49.429 Untitled[61397:a0f] Date: 2010-04-01 00:00:00 -0400 2010-03-14 19:11:49.430 Untitled[61397:a0f] 5 Weeks in Month 4 2010-03-14 19:11:49.431 Untitled[61397:a0f] Date: 2010-05-01 00:00:00 -0400 2010-03-14 19:11:49.431 Untitled[61397:a0f] 6 Weeks in Month 5 2010-03-14 19:11:49.432 Untitled[61397:a0f] Date: 2010-06-01 00:00:00 -0400 2010-03-14 19:11:49.433 Untitled[61397:a0f] 5 Weeks in Month 6 2010-03-14 19:11:49.434 Untitled[61397:a0f] Date: 2010-07-01 00:00:00 -0400 2010-03-14 19:11:49.434 Untitled[61397:a0f] 5 Weeks in Month 7 2010-03-14 19:11:49.435 Untitled[61397:a0f] Date: 2010-08-01 00:00:00 -0400 2010-03-14 19:11:49.436 Untitled[61397:a0f] 5 Weeks in Month 8 2010-03-14 19:11:49.437 Untitled[61397:a0f] Date: 2010-09-01 00:00:00 -0400 2010-03-14 19:11:49.437 Untitled[61397:a0f] 5 Weeks in Month 9 2010-03-14 19:11:49.438 Untitled[61397:a0f] Date: 2010-10-01 00:00:00 -0400 2010-03-14 19:11:49.439 Untitled[61397:a0f] 6 Weeks in Month 10 2010-03-14 19:11:49.439 Untitled[61397:a0f] Date: 2010-11-01 00:00:00 -0400 2010-03-14 19:11:49.440 Untitled[61397:a0f] 5 Weeks in Month 11 2010-03-14 19:11:49.441 Untitled[61397:a0f] Date: 2010-12-01 00:00:00 -0500 2010-03-14 19:11:49.441 Untitled[61397:a0f] 5 Weeks in Month 12