Added two static initializers to RKDotNetDateFormatter and amended the specs.

This commit is contained in:
Greg Combs
2011-09-09 09:51:35 -05:00
parent 9ce25f5689
commit 2bd113fd42
3 changed files with 55 additions and 13 deletions

View File

@@ -19,6 +19,17 @@ NSTimeInterval millisecondsFromSeconds(NSTimeInterval seconds);
@implementation RKDotNetDateFormatter
+ (RKDotNetDateFormatter *)dotNetDateFormatter {
return [RKDotNetDateFormatter dotNetDateFormatterWithTimeZone:nil];
}
+ (RKDotNetDateFormatter *)dotNetDateFormatterWithTimeZone:(NSTimeZone *)newTimeZone {
RKDotNetDateFormatter *formatter = [[[RKDotNetDateFormatter alloc] init] autorelease];
if (newTimeZone)
formatter.timeZone = newTimeZone;
return formatter;
}
- (NSDate *)dateFromString:(NSString *)string {
NSString *milliseconds = [self millisecondsFromString:string];
if (!milliseconds) {