// 得到當前本地時間,13位,整形
+ (long long)gs_getCurrentTimeToMilliSecond {
double currentTime = [[NSDate date] timeIntervalSince1970] * 1000;
long long iTime = (long long)currentTime;
return iTime;
}
//得到當前時間相對1970時間的字符串,精度到秒,返回10位長度字符串
+ (NSString *)gs_getCurrentTimeBySecond {
double currentTime = [[NSDate date] timeIntervalSince1970];
NSString *strTime = [NSString stringWithFormat:@"%.0f",currentTime];
return strTime;
}
/** 得到當前時間相對1970時間的字符串,精度到毫秒,返回13位長度字符串*/
+ (NSString *)gs_getCurrentTimeStringToMilliSecond {
double currentTime = [[NSDate date] timeIntervalSince1970]*1000;
NSString *strTime = [NSString stringWithFormat:@"%.0f",currentTime];
return strTime;
}