iphone-common-codes-ccteam源代码 CCNSCalendar.m
来源:互联网 发布:下载cctv网络电视 编辑:程序博客网 时间:2024/06/05 10:31
//// CCNSCalendar.m// CCFC//// Created by xichen on 11-12-17.// Copyright 2011年 ccteam. All rights reserved.//#import "CCNSCalendar.h"@implementation NSCalendar(cc)+ (id)GregorianCalendar{ return [[[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar] autorelease];}- (NSDateComponents *)getComponents{ NSInteger unitFlags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSWeekdayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit; NSDate *now = [NSDate date]; return [self components:unitFlags fromDate:now];}// you should call this immediately after getComponents method to make the result correctly.- (int)year:(NSDateComponents *)components{ return [components year];}// you should call this immediately after getComponents method to make the result correctly.- (int)month:(NSDateComponents *)components{ return [components month];}// you should call this immediately after getComponents method to make the result correctly.- (int)day:(NSDateComponents *)components{ return [components day];}// you should call this immediately after getComponents method to make the result correctly.- (int)hour:(NSDateComponents *)components{ return [components hour];}// you should call this immediately after getComponents method to make the result correctly.- (int)minute:(NSDateComponents *)components{ return [components minute];}// you should call this immediately after getComponents method to make the result correctly.- (int)seconds:(NSDateComponents *)components{ return [components second];}// you should call this immediately after getComponents method to make the result correctly.- (int)weekday:(NSDateComponents *)components{ return [components weekday];}@end
可能有更新:
googlecode链接地址:http://code.google.com/p/iphone-common-codes-ccteam/source/browse/trunk/CCFC/files/CCNSCalendar.m
github地址: https://github.com/cxsjabc/iphone-common-codes-ccteam/tree/master/CCFC/files/CCNSCalendar.m
- iphone-common-codes-ccteam源代码 CCNSCalendar.m
- iphone-common-codes-ccteam源代码 CCNSCalendar.h
- iphone-common-codes-ccteam源代码 CCAddressBook.m
- iphone-common-codes-ccteam源代码 CCAutoDisappearView.m
- iphone-common-codes-ccteam源代码 CCBaseTipView.m
- iphone-common-codes-ccteam源代码 CCCALayer.m
- iphone-common-codes-ccteam源代码 CCCamera.m
- iphone-common-codes-ccteam源代码 CCCommon.m
- iphone-common-codes-ccteam源代码 CCCompile.m
- iphone-common-codes-ccteam源代码 CCConfig.m
- iphone-common-codes-ccteam源代码 CCContact.m
- iphone-common-codes-ccteam源代码 CCDelete.m
- iphone-common-codes-ccteam源代码 CCDepend.m
- iphone-common-codes-ccteam源代码 CCDylib.m
- iphone-common-codes-ccteam源代码 CCEmoji.m
- iphone-common-codes-ccteam源代码 CCEncoding.m
- iphone-common-codes-ccteam源代码 CCFile.m
- iphone-common-codes-ccteam源代码 CCFileName.m
- 2318
- 第六章堆排序之“保持堆的性质MAX-HEAPIFY”(递归版)
- iphone-common-codes-ccteam源代码 CCNSArray.m
- iphone-common-codes-ccteam源代码 CCNSCalendar.h
- ASP.NET温故而知新学习系列之深度剖析ASP.NET架构—ASP.NET请求的处理过程(一)
- iphone-common-codes-ccteam源代码 CCNSCalendar.m
- iphone-common-codes-ccteam源代码 CCNSData.h
- 第六章堆排序之“保持堆的性质MAX-HEAPIFY”(迭代版,练习6.2-5)
- iphone-common-codes-ccteam源代码 CCNSData.m
- java动态代理
- iphone-common-codes-ccteam源代码 CCNSDate.h
- iphone-common-codes-ccteam源代码 CCNSDate.m
- iphone-common-codes-ccteam源代码 CCNSEnumerator.h
- VS2005新建Win32程序时,提示MSVCR80D.dll错误 解决方案