Anonymous user
Day of the week: Difference between revisions
m
→{{header|Objective-C}}: modernize
m (→{{header|Objective-C}}: modernize) |
|||
Line 1,464:
{{works with|GNUstep}}
{{works with|Cocoa}}
<lang objc>#import <Foundation/Foundation.h>
Line 1,471 ⟶ 1,470:
int main()
{
@autoreleasepool {
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);▼
}
▲ {
▲ 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);
▲ }
}
return 0;
}</lang>
|