NSCalendar * calendar = [NSCalendar currentCalendar];
NSDate * currentDate = [NSDate date];
NSInteger week = [calendar ordinalityOfUnit:NSCalendarUnitWeekday inUnit:NSCalendarUnitYear forDate:currentDate];
NSLog(@"今天是今年的第%ld周",week);
版权声明:本文为博主原创文章,未经博主允许不得转载。
原文地址:http://blog.csdn.net/yangchen9931/article/details/48049453