
日期计算
翻滚的code
情况是在不断的变化,要使自己的思想适应新的情况,就得学习。
展开
-
IOS 在当前日期时间加上 某个时间段(传负数即返回当前时间之前x月x日的时间)
/** * ** 在当前日期时间加上 某个时间段(传负数即返回当前时间之前x月x日的时间) * * @param year 当前时间若干年后 (传负数为当前时间若干年前) * @param month 当前时间若干月后 (传0即与当前时间一样) * @param day 当前时间若干天后 * @param hour 当前时原创 2018-01-18 11:43:40 · 1343 阅读 · 0 评论 -
IOS 字符串转日期
//字符串转日期 - (NSDate *)StringTODate:(NSString *)sender { NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; dateFormatter.dateFormat = @"YYYY-MM-dd HH:mm:ss";原创 2018-01-18 13:52:17 · 1149 阅读 · 0 评论