+ (NSDate *)dateWithCLRTicks:(int64_t)ticks {
return [NSDate dateWithCLRTicks:ticks withTimeIntervalAddition:0.0];
}
+ (NSDate *)dateWithCLRTicks:(int64_t)ticks withTimeIntervalAddition:(NSTimeInterval)timeIntervalAddition {
const double GMTOffset = [[NSTimeZone defaultTimeZone] secondsFromGMT];
const int64_t CLROffset = 621355968000000000;
double timeStamp = ((double)(ticks - CLROffset) / 10000000.0) - GMTOffset + timeIntervalAddition;
return [NSDate dateWithTimeIntervalSince1970:timeStamp];
}
网友评论