iOS单独对年月日加减
来源:互联网 发布:js join 编辑:程序博客网 时间:2024/05/21 17:23
1、当前时间减去18年
+ (NSDate *)dateWithYearsBeforeNow:(NSInteger)year{ NSDate *currentDate = currentDate = [NSDate date]; NSCalendar *calendar = nil; if (IOS8Higher) { calendar = [NSCalendar calendarWithIdentifier:NSCalendarIdentifierGregorian]; } else { calendar = [NSCalendar currentCalendar]; } NSDateComponents *dateComponents = [calendar components:NSYearCalendarUnit fromDate:currentDate]; [dateComponents setYear:year * -1]; return [calendar dateByAddingComponents:dateComponents toDate:currentDate options:0];}
0 0
- iOS单独对年月日加减
- java对Date的年月日的加减运算
- 日期运算加减年月日
- java中对Date类型的数据进行年月日的加减操作
- IOS开发之路-Objective-C 获得单独的年月日及星期
- MySQL - 分组,排序,取出单独的年月日
- sql单独获取时间的年月日部分
- IOS 获取年月日、星期
- iOS自定义年月日
- iOS 获取年月日
- IOS OC获取年月日
- iOS风格 年月日 选择器
- iOS NSDate日期加减
- iOS NSDate日期加减
- iOS NSDate日期加减
- iOS日期加减计算
- IOS加减选择器
- iOS UIStepper 加减计数器
- Struts中struts.xml配置文件的主要元素(result)
- 程序员遇到 Bug 时的 30 个反应,你是哪一种?
- MapReduce实战之WordCount
- HTML第七章上机练习1
- js判断手机浏览器
- iOS单独对年月日加减
- MathJax在页面中正常显示公式
- Mysql 用户权限相关操作
- 四叉树的构建-范围模拟分裂
- sql server DataTable 导excel
- 数模
- require.js使用(一)
- java中运行一段代码所需时间实现方式
- ROS 连接SICK LMS100激光,并用RVIZ显示(网线端口)