时间戳
程序员文章站
2022-07-03 14:59:13
...
获取当天零点的时间戳
- (NSString *)getZeroWithTimeInterverl{
NSDate *date = [NSDate dateWithTimeIntervalSince1970:[[NSDate date] timeIntervalSince1970]];
//格式化时间戳
NSDateFormatter *dateFomater = [[NSDateFormatter alloc]init];
dateFomater.dateFormat = @"yyyy年MM月dd日 HH:mm:ss";
NSString *nowDateStr = [dateFomater stringFromDate:date];
NSLog(@"nowDateStr===%@",nowDateStr);
NSString *result = [NSString stringWithFormat:@"%zd",(int)[date timeIntervalSince1970]];
return result;
}
上一篇: Android 单元测试之UI测试
下一篇: Flash详述