Updates to sending and message sequences
This commit is contained in:
@@ -9,3 +9,4 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NSString* MBIMWebServerFormatRFC822(NSDate *date);
|
||||
NSString* MBIMWebServerFormatISO8601(NSDate *date);
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "MBIMHTTPUtilities.h"
|
||||
|
||||
static NSDateFormatter* _dateFormatterRFC822 = nil;
|
||||
static NSDateFormatter* _dateFormatterISO8601 = nil;
|
||||
static dispatch_queue_t _dateFormatterQueue = NULL;
|
||||
|
||||
__attribute__((constructor))
|
||||
@@ -20,6 +21,11 @@ static void __InitializeDateFormatter()
|
||||
_dateFormatterRFC822.timeZone = [NSTimeZone timeZoneWithAbbreviation:@"GMT"];
|
||||
_dateFormatterRFC822.dateFormat = @"EEE',' dd MMM yyyy HH':'mm':'ss 'GMT'";
|
||||
_dateFormatterRFC822.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"];
|
||||
|
||||
_dateFormatterISO8601 = [[NSDateFormatter alloc] init];
|
||||
_dateFormatterISO8601.timeZone = [NSTimeZone timeZoneWithAbbreviation:@"GMT"];
|
||||
_dateFormatterISO8601.dateFormat = @"yyyy-MM-dd'T'HH:mm:ss'+00:00'";
|
||||
_dateFormatterISO8601.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"];
|
||||
}
|
||||
|
||||
NSString* MBIMWebServerFormatRFC822(NSDate *date)
|
||||
@@ -31,3 +37,13 @@ NSString* MBIMWebServerFormatRFC822(NSDate *date)
|
||||
|
||||
return string;
|
||||
}
|
||||
|
||||
NSString* MBIMWebServerFormatISO8601(NSDate *date)
|
||||
{
|
||||
__block NSString *string = nil;
|
||||
dispatch_sync(_dateFormatterQueue, ^{
|
||||
string = [_dateFormatterISO8601 stringFromDate:date];
|
||||
});
|
||||
|
||||
return string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user