+(NSString *)currentdateInterval
{
NSDate *datenow = [NSDate date];
NSString *timeSp = [NSString stringWithFormat:@"%ld", (long)([datenow timeIntervalSince1970]*1000)];
return timeSp;
}注:([datenow timeIntervalSince1970]*1000) 括号不能少,否则末3位为0
+(NSString *)currentdateInterval
{
NSDate *datenow = [NSDate date];
NSString *timeSp = [NSString stringWithFormat:@"%ld", (long)([datenow timeIntervalSince1970]*1000)];
return timeSp;
}注:([datenow timeIntervalSince1970]*1000) 括号不能少,否则末3位为0
本文标题:iOS获取当前时间和当前时间戳(秒、毫秒)
本文链接:https://www.haomeiwen.com/subject/sudljqtx.html
网友评论