iphone中的unix时间戳格式转换器

iphone中的unix时间戳格式转换器,iphone,Iphone,我在我的新应用程序中使用json。我用UNIX时间戳格式获取时间。我试着用这个代码来完成这件事 NSDate *date = [NSDate dateWithTimeIntervalSince1970:1234567]; NSDateComponents *weekdayComponents = [[NSCalendar currentCalendar] components:NSWeekdayCalendarUnit fromDate:date]; int weekday = [weekday

我在我的新应用程序中使用json。我用UNIX时间戳格式获取时间。我试着用这个代码来完成这件事

NSDate *date = [NSDate dateWithTimeIntervalSince1970:1234567];
NSDateComponents *weekdayComponents = [[NSCalendar currentCalendar] components:NSWeekdayCalendarUnit fromDate:date];
int weekday = [weekdayComponents weekday];
如果我试图通过硬涂层来消磨时间,但没有动态地工作,那么这是正确的。意味着我没有得到应该用哪种格式(小数,双精度)来传递变量来代替1234567

关于这一点,请帮助我。

参考1970年以来的带有时间间隔的日期:,您将看到它需要一个,这只是一个双精度