iOS NSString和NSDate轉換

後臺返回的時間字符串不是標準的時間而是計算機時間的時候,咱們須要將它們轉換爲標準時間,再進行轉換。 //字符串轉爲時間,時間格式本身定   NSString * time = @" 1501776000";   //時間字符串   NSInteger num = [time integerValue];   //轉爲int型   NSDateFormatter * formatter = [[NS
相關文章
相關標籤/搜索