iOS 把当前时间转化为时间戳

+ (NSString *)GetNowTimes

{

    NSDate *date = [NSDate dateWithTimeIntervalSinceNow:0];

    NSTimeInterval timeInterval = [date timeIntervalSince1970];

    NSString *timeString = [NSString stringWithFormat:@"%.0f", timeInterval];

    return timeString;

    

}

posted on 2016-06-22 10:28  哈利波特大  阅读(1314)  评论(0编辑  收藏  举报