Day of the week: Difference between revisions

m
Line 1,464:
 
{{works with|GNUstep}}
{{works with|Cocoa}}
 
It should works also with Cocoa and OpenStep in general, but I can't test these.
 
<lang objc>#import <Foundation/Foundation.h>
Line 1,471 ⟶ 1,470:
int main()
{
@autoreleasepool {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
for(NSUInteger i=2008; i<2121; i++)
}{
NSCalendarDate *d = [[NSCalendarDate alloc]
initWithYear: i
month: 12
day: 25
hour: 0 minute: 0 second:0
timeZone: [NSTimeZone timeZoneWithAbbreviation:@"CET"] ];
if ( [d dayOfWeek] == 0 )
{
printf("25 Dec %u is Sunday\n", i);
}
{ }
for(i=2008; i<2121; i++)
{
NSCalendarDate *d = [[NSCalendarDate alloc]
initWithYear: i
month: 12
day: 25
hour: 0 minute: 0 second:0
timeZone: [NSTimeZone timeZoneWithAbbreviation:@"CET"] ];
if ( [d dayOfWeek] == 0 )
{
printf("25 Dec %u is Sunday\n", i);
}
[d release];
}
[pool release];
return 0;
}</lang>
Anonymous user