Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #8 from carlj/master

Fixed Date Parse Bug in DynamoDBDescribeTableResponse
  • Loading branch information...
commit 28bf9f9ccc0d2f8bb5884957ba3f26019d0baa75 2 parents 2dc82be + 4b0b4b9
Yosuke Matsuda yosuke-matsuda authored
4 src/Amazon.DynamoDB/Model/DynamoDBProvisionedThroughputDescriptionUnmarshaller.m
View
@@ -28,12 +28,12 @@ +(DynamoDBProvisionedThroughputDescription *)unmarshall:(NSDictionary *)jsonObje
if ([jsonObject valueForKey:@"LastIncreaseDateTime"] != nil) {
- provisionedThroughputDescription.lastIncreaseDateTime = [AmazonSDKUtil millisSinceEpochToDate:[jsonObject valueForKey:@"LastIncreaseDateTime"]];
+ provisionedThroughputDescription.lastIncreaseDateTime = [AmazonSDKUtil secondsSinceEpochToDate:[jsonObject valueForKey:@"LastIncreaseDateTime"]];
}
if ([jsonObject valueForKey:@"LastDecreaseDateTime"] != nil) {
- provisionedThroughputDescription.lastDecreaseDateTime = [AmazonSDKUtil millisSinceEpochToDate:[jsonObject valueForKey:@"LastDecreaseDateTime"]];
+ provisionedThroughputDescription.lastDecreaseDateTime = [AmazonSDKUtil secondsSinceEpochToDate:[jsonObject valueForKey:@"LastDecreaseDateTime"]];
}
2  src/Amazon.DynamoDB/Model/DynamoDBTableDescriptionUnmarshaller.m
View
@@ -45,7 +45,7 @@ +(DynamoDBTableDescription *)unmarshall:(NSDictionary *)jsonObject
if ([jsonObject valueForKey:@"CreationDateTime"] != nil) {
- tableDescription.creationDateTime = [AmazonSDKUtil millisSinceEpochToDate:[jsonObject valueForKey:@"CreationDateTime"]];
+ tableDescription.creationDateTime = [AmazonSDKUtil secondsSinceEpochToDate:[jsonObject valueForKey:@"CreationDateTime"]];
}
5 src/Amazon.Runtime/AmazonSDKUtil.m
View
@@ -311,6 +311,11 @@ +(NSDate *)millisSinceEpochToDate:(NSNumber *)millisSinceEpoch
return [NSDate dateWithTimeIntervalSince1970:([millisSinceEpoch longLongValue] / 1000)];
}
++(NSDate *)secondsSinceEpochToDate:(NSNumber *)secondsSinceEpoch;
+{
+ return [NSDate dateWithTimeIntervalSince1970: [secondsSinceEpoch doubleValue] ];
+}
+
+(NSDate *)convertStringToDate:(NSString *)string usingFormat:(NSString *)dateFormat
{
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
1  src/include/AmazonSDKUtil.h
View
@@ -38,6 +38,7 @@
+(NSDate *)convertStringToDate:(NSString *)string;
+(NSDate *)convertStringToDate:(NSString *)string usingFormat:(NSString *)dateFormat;
+(NSDate *)millisSinceEpochToDate:(NSNumber *)millisSinceEpoch;
++(NSDate *)secondsSinceEpochToDate:(NSNumber *)secondsSinceEpoch;
+(NSURL *)URLWithURL:(NSURL *)theURL andProtocol:(NSString *)theProtocol;
+(NSLocale *)timestampLocale;
@end
Please sign in to comment.
Something went wrong with that request. Please try again.