iOS 获取 年 月 日

来源:互联网 发布:淘宝客qq群现在好做吗 编辑:程序博客网 时间:2024/05/17 21:50
    NSDate *  timeDate=[NSDate date];    NSCalendar  * cal=[NSCalendar currentCalendar];    NSUInteger  unitFlags=NSDayCalendarUnit|NSMonthCalendarUnit|NSYearCalendarUnit;    NSDateComponents * conponent= [cal components:unitFlags fromDate:timeDate];    NSInteger year=[conponent year];    NSInteger month=[conponent month];    NSInteger day=[conponent day];
0 0
原创粉丝点击