我只是感到困惑的是,是否有任何默认功能可以将两个 NSDate 值(例如 11-jan-2012 和 15-jan-2012 )连接为 11-15-jan-2012 。
2012年1月11日和2012年7月15日也称为2012年1月15日11日。
提前谢谢。
这很容易你可以..你可以获得日、月和年
NSDateComponents *components = [[NSCalendar currentCalendar] components:NSDayCalendarUnit | NSMonthCalendarUnit | NSYearCalendarUnit fromDate:[NSDate date]];
NSInteger dayM = [components day];
NSInteger monthM = [components month];
NSInteger yearM = [components year];
这些天你可以从中做这个,只需改变一下NSDate
日期与您的格式
然后根据需要每天连接
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)