|
|
@ -26,31 +26,6 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
return (uint64_t)(date.timeIntervalSince1970 * 1000);
|
|
|
|
return (uint64_t)(date.timeIntervalSince1970 * 1000);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#pragma mark - Debugging
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ (NSDateFormatter *)dateFormatterForDebugTimestamps
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
static NSDateFormatter *formatter;
|
|
|
|
|
|
|
|
static dispatch_once_t onceToken;
|
|
|
|
|
|
|
|
dispatch_once(&onceToken, ^{
|
|
|
|
|
|
|
|
formatter = [NSDateFormatter new];
|
|
|
|
|
|
|
|
[formatter setLocale:[NSLocale currentLocale]];
|
|
|
|
|
|
|
|
[formatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.SSS"];
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
return formatter;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ (NSString *)debugTimestamp
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// We use ows_millisecondTimeStamp for its higher precision.
|
|
|
|
|
|
|
|
return [[NSDate ows_dateWithMillisecondsSince1970:[NSDate ows_millisecondTimeStamp]] formattedAsDebugTimestamp];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- (NSString *)formattedAsDebugTimestamp
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return [[NSDate dateFormatterForDebugTimestamps] stringFromDate:self];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_END
|
|
|
|
NS_ASSUME_NONNULL_END
|
|
|
|